From 031dcbf15be5eef3d76488949ccebbf0872b1086 Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sat, 15 Feb 2020 17:37:05 +0100 Subject: [PATCH] Fix crash in some Eevee shader node setups after vector math node changes --- .../blender/nodes/shader/nodes/node_shader_geometry.c | 10 ++++++++-- .../blender/nodes/shader/nodes/node_shader_tex_coord.c | 10 ++++++++-- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/source/blender/nodes/shader/nodes/node_shader_geometry.c b/source/blender/nodes/shader/nodes/node_shader_geometry.c index d24d83dbc8a..6b23fec5f18 100644 --- a/source/blender/nodes/shader/nodes/node_shader_geometry.c +++ b/source/blender/nodes/shader/nodes/node_shader_geometry.c @@ -68,8 +68,14 @@ static int node_shader_gpu_geometry(GPUMaterial *mat, * The resulting vector can still be a bit wrong but not as much. * (see T70644) */ if (node->branch_tag != 0 && ELEM(i, 1, 2, 4)) { - GPU_link( - mat, "vector_math_normalize", out[i].link, out[i].link, out[i].link, &out[i].link, NULL); + GPU_link(mat, + "vector_math_normalize", + out[i].link, + out[i].link, + out[i].link, + out[i].link, + &out[i].link, + NULL); } } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_coord.c b/source/blender/nodes/shader/nodes/node_shader_tex_coord.c index 8bb17acc4d3..3c1a2280aae 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_coord.c +++ b/source/blender/nodes/shader/nodes/node_shader_tex_coord.c @@ -68,8 +68,14 @@ static int node_shader_gpu_tex_coord(GPUMaterial *mat, * The resulting vector can still be a bit wrong but not as much. * (see T70644) */ if (node->branch_tag != 0 && ELEM(i, 1, 6)) { - GPU_link( - mat, "vector_math_normalize", out[i].link, out[i].link, out[i].link, &out[i].link, NULL); + GPU_link(mat, + "vector_math_normalize", + out[i].link, + out[i].link, + out[i].link, + out[i].link, + &out[i].link, + NULL); } }