mirror of
https://github.com/godotengine/godot
synced 2024-09-05 19:09:37 +00:00
Fix VisualShaderNodeVaryingGetter expanded ports adding ".x" to shader
When VisualShaderNodeVaryingGetter type was Vector2/Vector3/Vector4, expanding the output ports and connecting an individual value to a scalar input would add ".x" to the assignment in the generated shader. This was due to `VisualShaderNodeVarying::get_port_type` ignoring the port number, and always returning the associated vector type. Added checks for `p_port == 0` to return either the vector type, or scalar for expanded ports, matching similar logic in other nodes, like `VisualShaderNodeColorConstant::get_output_port_type`. Fixes #92832
This commit is contained in:
parent
e96ad5af98
commit
73343a2e7f
|
@ -5162,11 +5162,11 @@ VisualShaderNodeVarying::PortType VisualShaderNodeVarying::get_port_type(VisualS
|
|||
case VisualShader::VARYING_TYPE_UINT:
|
||||
return PORT_TYPE_SCALAR_UINT;
|
||||
case VisualShader::VARYING_TYPE_VECTOR_2D:
|
||||
return PORT_TYPE_VECTOR_2D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_2D : PORT_TYPE_SCALAR;
|
||||
case VisualShader::VARYING_TYPE_VECTOR_3D:
|
||||
return PORT_TYPE_VECTOR_3D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_3D : PORT_TYPE_SCALAR;
|
||||
case VisualShader::VARYING_TYPE_VECTOR_4D:
|
||||
return PORT_TYPE_VECTOR_4D;
|
||||
return p_port == 0 ? PORT_TYPE_VECTOR_4D : PORT_TYPE_SCALAR;
|
||||
case VisualShader::VARYING_TYPE_BOOLEAN:
|
||||
return PORT_TYPE_BOOLEAN;
|
||||
case VisualShader::VARYING_TYPE_TRANSFORM:
|
||||
|
|
Loading…
Reference in a new issue