Fix crash in some Eevee shader node setups after vector math node changes

This commit is contained in:
Brecht Van Lommel
2020-02-15 17:37:05 +01:00
parent 50975026ff
commit 031dcbf15b
2 changed files with 16 additions and 4 deletions

View File

@@ -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);
}
}

View File

@@ -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);
}
}