Merge pull request #37462 from Chaosus/shader_fix_const_order
[3.2] Fix shader constant sorting
This commit is contained in:
@ -5156,6 +5156,7 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
|
||||
|
||||
while (true) {
|
||||
ShaderNode::Constant constant;
|
||||
constant.name = name;
|
||||
constant.type = type;
|
||||
constant.precision = precision;
|
||||
constant.initializer = NULL;
|
||||
@ -5190,6 +5191,8 @@ Error ShaderLanguage::_parse_shader(const Map<StringName, FunctionInfo> &p_funct
|
||||
}
|
||||
|
||||
shader->constants[name] = constant;
|
||||
shader->vconstants.push_back(constant);
|
||||
|
||||
if (tk.type == TK_COMMA) {
|
||||
tk = _get_token();
|
||||
if (tk.type != TK_IDENTIFIER) {
|
||||
|
||||
@ -512,6 +512,7 @@ public:
|
||||
struct ShaderNode : public Node {
|
||||
|
||||
struct Constant {
|
||||
StringName name;
|
||||
DataType type;
|
||||
DataPrecision precision;
|
||||
ConstantNode *initializer;
|
||||
@ -577,6 +578,7 @@ public:
|
||||
Vector<StringName> render_modes;
|
||||
|
||||
Vector<Function> functions;
|
||||
Vector<Constant> vconstants;
|
||||
|
||||
ShaderNode() :
|
||||
Node(TYPE_SHADER) {}
|
||||
|
||||
Reference in New Issue
Block a user