summaryrefslogtreecommitdiff
path: root/servers/rendering/shader_language.h
diff options
context:
space:
mode:
Diffstat (limited to 'servers/rendering/shader_language.h')
-rw-r--r--servers/rendering/shader_language.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/servers/rendering/shader_language.h b/servers/rendering/shader_language.h
index 2b147fbeb1..4a67e4d088 100644
--- a/servers/rendering/shader_language.h
+++ b/servers/rendering/shader_language.h
@@ -38,6 +38,7 @@
#include "core/templates/rb_map.h"
#include "core/typedefs.h"
#include "core/variant/variant.h"
+#include "scene/resources/shader_include.h"
#ifdef DEBUG_ENABLED
#include "shader_warnings.h"
@@ -867,6 +868,11 @@ public:
typedef DataType (*GlobalVariableGetTypeFunc)(const StringName &p_name);
+ struct FilePosition {
+ String file;
+ int line = 0;
+ };
+
private:
struct KeyWord {
TokenType token;
@@ -884,6 +890,8 @@ private:
String error_str;
int error_line = 0;
+ Vector<FilePosition> include_positions;
+
#ifdef DEBUG_ENABLED
struct Usage {
int decl_line;
@@ -928,6 +936,7 @@ private:
StringName current_function;
bool last_const = false;
StringName last_name;
+ bool is_shader_inc = false;
VaryingFunctionNames varying_function_names;
@@ -951,6 +960,7 @@ private:
error_line = tk_line;
error_set = true;
error_str = p_str;
+ include_positions.write[include_positions.size() - 1].line = tk_line;
}
void _set_expected_error(const String &p_what) {
@@ -1098,12 +1108,14 @@ public:
VaryingFunctionNames varying_function_names = VaryingFunctionNames();
HashSet<String> shader_types;
GlobalVariableGetTypeFunc global_variable_type_func = nullptr;
+ bool is_include = false;
};
Error compile(const String &p_code, const ShaderCompileInfo &p_info);
Error complete(const String &p_code, const ShaderCompileInfo &p_info, List<ScriptLanguage::CodeCompletionOption> *r_options, String &r_call_hint);
String get_error_text();
+ Vector<FilePosition> get_include_positions();
int get_error_line();
ShaderNode *get_shader();