From 6673c76e78742c64ccd0afa7a9d1f598a8022878 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Sun, 20 Nov 2011 16:38:23 +0000 Subject: Muting node patch: second part. Also fix [#27636] Muting shading nodes is ignored MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Now, compositing, shading and texture nodes have a consistent muting system, with default behaving as previous (for compo), and which can be optionaly customized by each node. Shader nodes are also GLSL muted. However, Cycles is currently unaware of muted nodes, will try to address this… --- source/blender/gpu/intern/gpu_codegen.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'source/blender/gpu/intern/gpu_codegen.c') diff --git a/source/blender/gpu/intern/gpu_codegen.c b/source/blender/gpu/intern/gpu_codegen.c index 35ef48250cc..4a923e66356 100644 --- a/source/blender/gpu/intern/gpu_codegen.c +++ b/source/blender/gpu/intern/gpu_codegen.c @@ -54,6 +54,8 @@ #include "gpu_codegen.h" +#include "node_util.h" /* For muting node stuff... */ + #include #include @@ -1212,6 +1214,31 @@ int GPU_stack_link(GPUMaterial *mat, const char *name, GPUNodeStack *in, GPUNode return 1; } +int GPU_stack_link_mute(GPUMaterial *mat, const char *name, LinkInOutsMuteNode *mlnk) +{ + GPUNode *node; + GPUFunction *function; + int i; + + function = GPU_lookup_function(name); + if(!function) { + fprintf(stderr, "GPU failed to find function %s\n", name); + return 0; + } + + for(i = 0; i < mlnk->num_outs; i++) { + node = GPU_node_begin(name); + gpu_node_input_socket(node, (GPUNodeStack*)mlnk->in); + GPU_node_output(node, ((GPUNodeStack*)mlnk->outs+i)->type, ((GPUNodeStack*)mlnk->outs+i)->name, + &((GPUNodeStack*)mlnk->outs+i)->link); + GPU_node_end(node); + + gpu_material_add_node(mat, node); + } + + return 1; +} + int GPU_link_changed(GPUNodeLink *link) { GPUNode *node; -- cgit v1.2.3