diff options
Diffstat (limited to 'source/blender/gpu/intern/gpu_node_graph.c')
-rw-r--r-- | source/blender/gpu/intern/gpu_node_graph.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/gpu/intern/gpu_node_graph.c b/source/blender/gpu/intern/gpu_node_graph.c index c890d56994f..fdf8ba172cb 100644 --- a/source/blender/gpu/intern/gpu_node_graph.c +++ b/source/blender/gpu/intern/gpu_node_graph.c @@ -132,7 +132,10 @@ static void gpu_node_input_link(GPUNode *node, GPUNodeLink *link, const eGPUType case GPU_NODE_LINK_ATTR: input->source = GPU_SOURCE_ATTR; input->attr = link->attr; - input->attr->gputype = type; + /* Failsafe handling if the same attribute is used with different datatypes for + * some reason (only really makes sense with float/vec2/vec3/vec4 though). This + * can happen if mixing the generic Attribute node with specialized ones. */ + CLAMP_MIN(input->attr->gputype, type); break; case GPU_NODE_LINK_CONSTANT: input->source = (type == GPU_CLOSURE) ? GPU_SOURCE_STRUCT : GPU_SOURCE_CONSTANT; |