summaryrefslogtreecommitdiffstats
path: root/servers/rendering/shader_language.h
diff options
context:
space:
mode:
authorYuri Roubinsky <chaosus89@gmail.com>2022-04-27 14:18:32 +0300
committerYuri Roubinsky <chaosus89@gmail.com>2022-04-29 08:40:43 +0300
commit15032e01e6be06edc10457a8cd3457b1cb6cd26e (patch)
tree3d0b8b2830fc285995a480b184d2b437c01e5afd /servers/rendering/shader_language.h
parentcbdc33bcf73090962e60c1cf5ee50a21b29e4bad (diff)
downloadredot-engine-15032e01e6be06edc10457a8cd3457b1cb6cd26e.tar.gz
Add keyword completion to shader editor
Diffstat (limited to 'servers/rendering/shader_language.h')
-rw-r--r--servers/rendering/shader_language.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/servers/rendering/shader_language.h b/servers/rendering/shader_language.h
index de6d912a4f..f24c9e9e0f 100644
--- a/servers/rendering/shader_language.h
+++ b/servers/rendering/shader_language.h
@@ -756,6 +756,7 @@ public:
static bool is_token_interpolation(TokenType p_type);
static DataInterpolation get_token_interpolation(TokenType p_type);
static bool is_token_precision(TokenType p_type);
+ static bool is_token_arg_qual(TokenType p_type);
static DataPrecision get_token_precision(TokenType p_type);
static String get_precision_name(DataPrecision p_type);
static String get_datatype_name(DataType p_type);
@@ -870,6 +871,9 @@ private:
struct KeyWord {
TokenType token;
const char *text;
+ uint32_t flags;
+ const Vector<String> excluded_shader_types;
+ const Vector<String> functions;
};
static const KeyWord keyword_list[];
@@ -920,6 +924,7 @@ private:
int char_idx;
int tk_line;
+ StringName shader_type_identifier;
StringName current_function;
bool last_const = false;
StringName last_name;
@@ -972,6 +977,7 @@ private:
Token _make_token(TokenType p_type, const StringName &p_text = StringName());
Token _get_token();
+ bool _lookup_next(Token &r_tk);
ShaderNode *shader = nullptr;
@@ -1029,6 +1035,10 @@ private:
StringName completion_struct;
int completion_argument;
+#ifdef DEBUG_ENABLED
+ uint32_t keyword_completion_context;
+#endif // DEBUG_ENABLED
+
const Map<StringName, FunctionInfo> *stages = nullptr;
bool _get_completable_identifier(BlockNode *p_block, CompletionType p_type, StringName &identifier);