Merge pull request #31473 from Chaosus/shader_bug
Fix ternary operator shader compiler expression
This commit is contained in:
commit
cce148b024
|
@ -758,11 +758,13 @@ String ShaderCompilerGLES2::_dump_node_code(SL::Node *p_node, int p_level, Gener
|
|||
} break;
|
||||
|
||||
case SL::OP_SELECT_IF: {
|
||||
code += "(";
|
||||
code += _dump_node_code(op_node->arguments[0], p_level, r_gen_code, p_actions, p_default_actions, p_assigning);
|
||||
code += " ? ";
|
||||
code += _dump_node_code(op_node->arguments[1], p_level, r_gen_code, p_actions, p_default_actions, p_assigning);
|
||||
code += " : ";
|
||||
code += _dump_node_code(op_node->arguments[2], p_level, r_gen_code, p_actions, p_default_actions, p_assigning);
|
||||
code += ")";
|
||||
} break;
|
||||
|
||||
case SL::OP_MOD: {
|
||||
|
|
|
@ -772,11 +772,13 @@ String ShaderCompilerGLES3::_dump_node_code(SL::Node *p_node, int p_level, Gener
|
|||
} break;
|
||||
case SL::OP_SELECT_IF: {
|
||||
|
||||
code += "(";
|
||||
code += _dump_node_code(onode->arguments[0], p_level, r_gen_code, p_actions, p_default_actions, p_assigning);
|
||||
code += "?";
|
||||
code += _dump_node_code(onode->arguments[1], p_level, r_gen_code, p_actions, p_default_actions, p_assigning);
|
||||
code += ":";
|
||||
code += _dump_node_code(onode->arguments[2], p_level, r_gen_code, p_actions, p_default_actions, p_assigning);
|
||||
code += ")";
|
||||
|
||||
} break;
|
||||
|
||||
|
|
Loading…
Reference in New Issue