From d7d180bd3d8d513724f7f47800f75919295ae11b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Thu, 28 Feb 2019 13:56:03 +0100 Subject: Fix T62021: Wireframe input node doesn't work properly This fixes the general case. It is still not supported for hairs. Added a hack in the geometry node to avoid unnecessary geometry shader usage. --- source/blender/nodes/shader/nodes/node_shader_geometry.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'source/blender/nodes') diff --git a/source/blender/nodes/shader/nodes/node_shader_geometry.c b/source/blender/nodes/shader/nodes/node_shader_geometry.c index 241b6b863e4..4c4ad7c4cc9 100644 --- a/source/blender/nodes/shader/nodes/node_shader_geometry.c +++ b/source/blender/nodes/shader/nodes/node_shader_geometry.c @@ -35,10 +35,13 @@ static bNodeSocketTemplate sh_node_geometry_out[] = { static int node_shader_gpu_geometry(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out) { + /* HACK: Don't request GPU_BARYCENTRIC_TEXCO if not used because it will + * trigger the use of geometry shader (and the performance penalty it implies). */ + eGPUBuiltin bary_builtin = (out[7].type == GPU_NONE) ? GPU_VIEW_NORMAL : GPU_BARYCENTRIC_TEXCO; return GPU_stack_link(mat, node, "node_geometry", in, out, GPU_builtin(GPU_VIEW_POSITION), GPU_builtin(GPU_VIEW_NORMAL), GPU_attribute(CD_ORCO, ""), GPU_builtin(GPU_OBJECT_MATRIX), - GPU_builtin(GPU_INVERSE_VIEW_MATRIX), GPU_builtin(GPU_BARYCENTRIC_TEXCO)); + GPU_builtin(GPU_INVERSE_VIEW_MATRIX), GPU_builtin(bary_builtin)); } /* node type definition */ -- cgit v1.2.3