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:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2014-02-14 18:11:19 +0400
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2014-02-14 18:11:58 +0400
commita252e27fec16e09efe873a6bbbd29b3ad5d4c67f (patch)
treef5f98df5363c83acdc51b911f55261f5fe334f9c /source/blender/nodes
parent8439a165ff50a6b3f690c04347aae8a253e08ca2 (diff)
Fix T38633: glsl not working well with mixed cycles/blender material nodes.
Diffstat (limited to 'source/blender/nodes')
-rw-r--r--source/blender/nodes/shader/node_shader_tree.c4
-rw-r--r--source/blender/nodes/shader/node_shader_util.c7
-rw-r--r--source/blender/nodes/shader/node_shader_util.h2
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_common.c2
4 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c
index 1e828ea321c..2186eb7c226 100644
--- a/source/blender/nodes/shader/node_shader_tree.c
+++ b/source/blender/nodes/shader/node_shader_tree.c
@@ -187,14 +187,14 @@ void register_node_tree_type_sh(void)
/* GPU material from shader nodes */
-void ntreeGPUMaterialNodes(bNodeTree *ntree, GPUMaterial *mat)
+void ntreeGPUMaterialNodes(bNodeTree *ntree, GPUMaterial *mat, short compatibility)
{
/* localize tree to create links for reroute and mute */
bNodeTree *localtree = ntreeLocalize(ntree);
bNodeTreeExec *exec;
exec = ntreeShaderBeginExecTree(localtree);
- ntreeExecGPUNodes(exec, mat, 1);
+ ntreeExecGPUNodes(exec, mat, 1, compatibility);
ntreeShaderEndExecTree(exec);
ntreeFreeTree_ex(localtree, false);
diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c
index 86e59cd779a..8e83140733a 100644
--- a/source/blender/nodes/shader/node_shader_util.c
+++ b/source/blender/nodes/shader/node_shader_util.c
@@ -219,7 +219,7 @@ bNode *nodeGetActiveTexture(bNodeTree *ntree)
return inactivenode;
}
-void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, int do_outputs)
+void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, int do_outputs, short compatibility)
{
bNodeExec *nodeexec;
bNode *node;
@@ -238,8 +238,9 @@ void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, int do_outputs)
do_it = FALSE;
/* for groups, only execute outputs for edited group */
if (node->typeinfo->nclass == NODE_CLASS_OUTPUT) {
- if (do_outputs && (node->flag & NODE_DO_OUTPUT))
- do_it = TRUE;
+ if (node->typeinfo->compatibility & compatibility)
+ if (do_outputs && (node->flag & NODE_DO_OUTPUT))
+ do_it = TRUE;
}
else
do_it = TRUE;
diff --git a/source/blender/nodes/shader/node_shader_util.h b/source/blender/nodes/shader/node_shader_util.h
index cfd97ab0d9e..8a79603fab4 100644
--- a/source/blender/nodes/shader/node_shader_util.h
+++ b/source/blender/nodes/shader/node_shader_util.h
@@ -98,6 +98,6 @@ void node_gpu_stack_from_data(struct GPUNodeStack *gs, int type, struct bNodeSta
void node_data_from_gpu_stack(struct bNodeStack *ns, struct GPUNodeStack *gs);
void node_shader_gpu_tex_mapping(struct GPUMaterial *mat, struct bNode *node, struct GPUNodeStack *in, struct GPUNodeStack *out);
-void ntreeExecGPUNodes(struct bNodeTreeExec *exec, struct GPUMaterial *mat, int do_outputs);
+void ntreeExecGPUNodes(struct bNodeTreeExec *exec, struct GPUMaterial *mat, int do_outputs, short compatibility);
#endif
diff --git a/source/blender/nodes/shader/nodes/node_shader_common.c b/source/blender/nodes/shader/nodes/node_shader_common.c
index 0ea4f949597..3f03bb45d8f 100644
--- a/source/blender/nodes/shader/nodes/node_shader_common.c
+++ b/source/blender/nodes/shader/nodes/node_shader_common.c
@@ -218,7 +218,7 @@ static int gpu_group_execute(GPUMaterial *mat, bNode *node, bNodeExecData *execd
#if 0 /* XXX NODE_GROUP_EDIT is deprecated, depends on node space */
ntreeExecGPUNodes(exec, mat, (node->flag & NODE_GROUP_EDIT));
#else
- ntreeExecGPUNodes(exec, mat, 0);
+ ntreeExecGPUNodes(exec, mat, 0, NODE_NEW_SHADING|NODE_OLD_SHADING);
#endif
group_gpu_move_outputs(node, out, exec->stack);