diff options
Diffstat (limited to 'source/blender/nodes/shader/nodes/node_shader_geometry.cc')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_geometry.cc | 20 |
1 files changed, 4 insertions, 16 deletions
diff --git a/source/blender/nodes/shader/nodes/node_shader_geometry.cc b/source/blender/nodes/shader/nodes/node_shader_geometry.cc index 5bd984ddfc4..47df932f9d4 100644 --- a/source/blender/nodes/shader/nodes/node_shader_geometry.cc +++ b/source/blender/nodes/shader/nodes/node_shader_geometry.cc @@ -24,29 +24,17 @@ static int node_shader_gpu_geometry(GPUMaterial *mat, GPUNodeStack *in, GPUNodeStack *out) { - /* HACK: Don't request GPU_BARYCENTRIC_TEXCO if not used because it will + /* HACK: Don't request GPU_MATFLAG_BARYCENTRIC if not used because it will * trigger the use of geometry shader (and the performance penalty it implies). */ - const float val[4] = {0.0f, 0.0f, 0.0f, 0.0f}; - GPUNodeLink *bary_link = (!out[5].hasoutput) ? GPU_constant(val) : - GPU_builtin(GPU_BARYCENTRIC_TEXCO); if (out[5].hasoutput) { GPU_material_flag_set(mat, GPU_MATFLAG_BARYCENTRIC); } /* Opti: don't request orco if not needed. */ + const float val[4] = {0.0f, 0.0f, 0.0f, 0.0f}; GPUNodeLink *orco_link = (!out[2].hasoutput) ? GPU_constant(val) : GPU_attribute(mat, CD_ORCO, ""); - const bool success = GPU_stack_link(mat, - node, - "node_geometry", - in, - out, - GPU_builtin(GPU_VIEW_POSITION), - GPU_builtin(GPU_WORLD_NORMAL), - orco_link, - GPU_builtin(GPU_OBJECT_MATRIX), - GPU_builtin(GPU_INVERSE_VIEW_MATRIX), - bary_link); + const bool success = GPU_stack_link(mat, node, "node_geometry", in, out, orco_link); int i; LISTBASE_FOREACH_INDEX (bNodeSocket *, sock, &node->outputs, i) { @@ -55,7 +43,7 @@ static int node_shader_gpu_geometry(GPUMaterial *mat, * This is the case for interpolated, non linear functions. * 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)) { + if (ELEM(i, 1, 2, 4)) { GPU_link(mat, "vector_math_normalize", out[i].link, |