summaryrefslogtreecommitdiff
path: root/scene/resources/visual_shader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'scene/resources/visual_shader.cpp')
-rw-r--r--scene/resources/visual_shader.cpp40
1 files changed, 30 insertions, 10 deletions
diff --git a/scene/resources/visual_shader.cpp b/scene/resources/visual_shader.cpp
index 3b245f908a..5637aaec9a 100644
--- a/scene/resources/visual_shader.cpp
+++ b/scene/resources/visual_shader.cpp
@@ -1229,11 +1229,21 @@ Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBui
for (int i = 0; i < output_count; i++) {
String var_name = "n_out" + itos(node) + "p" + itos(i);
switch (vsnode->get_output_port_type(i)) {
- case VisualShaderNode::PORT_TYPE_SCALAR: outputs[i] = "float " + var_name; break;
- case VisualShaderNode::PORT_TYPE_SCALAR_INT: outputs[i] = "int " + var_name; break;
- case VisualShaderNode::PORT_TYPE_VECTOR: outputs[i] = "vec3 " + var_name; break;
- case VisualShaderNode::PORT_TYPE_BOOLEAN: outputs[i] = "bool " + var_name; break;
- case VisualShaderNode::PORT_TYPE_TRANSFORM: outputs[i] = "mat4 " + var_name; break;
+ case VisualShaderNode::PORT_TYPE_SCALAR:
+ outputs[i] = "float " + var_name;
+ break;
+ case VisualShaderNode::PORT_TYPE_SCALAR_INT:
+ outputs[i] = "int " + var_name;
+ break;
+ case VisualShaderNode::PORT_TYPE_VECTOR:
+ outputs[i] = "vec3 " + var_name;
+ break;
+ case VisualShaderNode::PORT_TYPE_BOOLEAN:
+ outputs[i] = "bool " + var_name;
+ break;
+ case VisualShaderNode::PORT_TYPE_TRANSFORM:
+ outputs[i] = "mat4 " + var_name;
+ break;
default: {
}
}
@@ -1243,11 +1253,21 @@ Error VisualShader::_write_node(Type type, StringBuilder &global_code, StringBui
for (int i = 0; i < output_count; i++) {
outputs[i] = "n_out" + itos(node) + "p" + itos(i);
switch (vsnode->get_output_port_type(i)) {
- case VisualShaderNode::PORT_TYPE_SCALAR: code += String() + "\tfloat " + outputs[i] + ";\n"; break;
- case VisualShaderNode::PORT_TYPE_SCALAR_INT: code += String() + "\tint " + outputs[i] + ";\n"; break;
- case VisualShaderNode::PORT_TYPE_VECTOR: code += String() + "\tvec3 " + outputs[i] + ";\n"; break;
- case VisualShaderNode::PORT_TYPE_BOOLEAN: code += String() + "\tbool " + outputs[i] + ";\n"; break;
- case VisualShaderNode::PORT_TYPE_TRANSFORM: code += String() + "\tmat4 " + outputs[i] + ";\n"; break;
+ case VisualShaderNode::PORT_TYPE_SCALAR:
+ code += String() + "\tfloat " + outputs[i] + ";\n";
+ break;
+ case VisualShaderNode::PORT_TYPE_SCALAR_INT:
+ code += String() + "\tint " + outputs[i] + ";\n";
+ break;
+ case VisualShaderNode::PORT_TYPE_VECTOR:
+ code += String() + "\tvec3 " + outputs[i] + ";\n";
+ break;
+ case VisualShaderNode::PORT_TYPE_BOOLEAN:
+ code += String() + "\tbool " + outputs[i] + ";\n";
+ break;
+ case VisualShaderNode::PORT_TYPE_TRANSFORM:
+ code += String() + "\tmat4 " + outputs[i] + ";\n";
+ break;
default: {
}
}