Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2011-11-20 20:38:23 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2011-11-20 20:38:23 +0400
commit6673c76e78742c64ccd0afa7a9d1f598a8022878 (patch)
tree5304bf79c57391c4dcc561746e770e006ba45e18 /source/blender/gpu/intern/gpu_codegen.c
parentbbf8315313a9e221ba398bbe06e342bd949c973b (diff)
Muting node patch: second part. Also fix [#27636] Muting shading nodes is ignored
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…
Diffstat (limited to 'source/blender/gpu/intern/gpu_codegen.c')
-rw-r--r--source/blender/gpu/intern/gpu_codegen.c27
1 files changed, 27 insertions, 0 deletions
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 <string.h>
#include <stdarg.h>
@@ -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;