Fix shader crash when using a varying in separate func before it defined

This commit is contained in:
Yuri Rubinsky
2024-07-23 21:07:33 +03:00
parent 8e36f98ea5
commit 965b2f6ca4
2 changed files with 34 additions and 9 deletions

View File

@ -917,8 +917,21 @@ private:
// Additional function information (eg. call hierarchy). No need to expose it to compiler.
struct CallInfo {
struct Item {
enum ItemType {
ITEM_TYPE_BUILTIN,
ITEM_TYPE_VARYING,
} type;
TkPos pos;
Item() {}
Item(ItemType p_type, TkPos p_pos) :
type(p_type), pos(p_pos) {}
};
StringName name;
List<Pair<StringName, TkPos>> uses_restricted_functions;
List<Pair<StringName, Item>> uses_restricted_items;
List<CallInfo *> calls;
};