You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-13 13:31:48 +00:00
Allow pass varyings as out param to the function, when it's possible
This commit is contained in:
@@ -294,6 +294,17 @@ public:
|
||||
TAG_ARRAY,
|
||||
};
|
||||
|
||||
struct VaryingFunctionNames {
|
||||
StringName fragment;
|
||||
StringName vertex;
|
||||
StringName light;
|
||||
VaryingFunctionNames() {
|
||||
fragment = "fragment";
|
||||
vertex = "vertex";
|
||||
light = "light";
|
||||
}
|
||||
};
|
||||
|
||||
struct Node {
|
||||
Node *next;
|
||||
|
||||
@@ -516,6 +527,7 @@ public:
|
||||
|
||||
struct MemberNode : public Node {
|
||||
DataType basetype;
|
||||
bool basetype_const;
|
||||
StringName base_struct_name;
|
||||
DataPrecision precision;
|
||||
DataType datatype;
|
||||
@@ -533,6 +545,7 @@ public:
|
||||
MemberNode() :
|
||||
Node(TYPE_MEMBER),
|
||||
basetype(TYPE_VOID),
|
||||
basetype_const(false),
|
||||
datatype(TYPE_VOID),
|
||||
array_size(0),
|
||||
owner(nullptr),
|
||||
@@ -763,13 +776,7 @@ private:
|
||||
StringName current_function;
|
||||
bool last_const = false;
|
||||
|
||||
struct VaryingUsage {
|
||||
ShaderNode::Varying *var;
|
||||
int line;
|
||||
};
|
||||
List<VaryingUsage> unknown_varying_usages;
|
||||
|
||||
bool _check_varying_usages(int *r_error_line, String *r_error_message) const;
|
||||
VaryingFunctionNames varying_function_names;
|
||||
|
||||
TkPos _get_tkpos() {
|
||||
TkPos tkp;
|
||||
@@ -848,7 +855,6 @@ private:
|
||||
bool _validate_function_call(BlockNode *p_block, OperatorNode *p_func, DataType *r_ret_type, StringName *r_ret_type_str);
|
||||
bool _parse_function_arguments(BlockNode *p_block, const Map<StringName, BuiltInInfo> &p_builtin_types, OperatorNode *p_func, int *r_complete_arg = nullptr);
|
||||
bool _validate_varying_assign(ShaderNode::Varying &p_varying, String *r_message);
|
||||
bool _validate_varying_using(ShaderNode::Varying &p_varying, String *r_message);
|
||||
|
||||
Node *_parse_expression(BlockNode *p_block, const Map<StringName, BuiltInInfo> &p_builtin_types);
|
||||
Node *_parse_array_constructor(BlockNode *p_block, const Map<StringName, BuiltInInfo> &p_builtin_types, DataType p_type, const StringName &p_struct_name, int p_array_size);
|
||||
|
||||
Reference in New Issue
Block a user