diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2019-02-28 15:56:03 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2019-02-28 16:11:12 +0300 |
commit | d7d180bd3d8d513724f7f47800f75919295ae11b (patch) | |
tree | 6de9bcec3c372fe9256d457572966d61f8926810 /source/blender/nodes | |
parent | d68484a60f539339db12a7eedd0ead0f116a43d5 (diff) |
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.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r-- | source/blender/nodes/shader/nodes/node_shader_geometry.c | 5 |
1 files changed, 4 insertions, 1 deletions
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 */ |