From 96de11c2c67e332dc0d303210fd1fddbb532c5ca Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 2 Apr 2019 16:37:54 +0200 Subject: Fix T62434: EEVEE not using correct World Output node We were already getting the designated output node in 'ntreeGPUMaterialNodes()' but this wasnt used in 'ntreeExecGPUNodes()', instead whatever node was tagged NODE_DO_OUTPUT was executed. note: this is just the bare minimum to fix the bug, other improvements previously done in D4482 might follow as a separate commit. Reviewers: brecht, fclem Maniphest Tasks: T62434 Differential Revision: https://developer.blender.org/D4630 --- source/blender/nodes/shader/node_shader_tree.c | 2 +- source/blender/nodes/shader/node_shader_util.c | 4 ++-- source/blender/nodes/shader/node_shader_util.h | 2 +- source/blender/nodes/shader/nodes/node_shader_common.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) (limited to 'source/blender/nodes') diff --git a/source/blender/nodes/shader/node_shader_tree.c b/source/blender/nodes/shader/node_shader_tree.c index a4356dabfc0..9f01d2ab254 100644 --- a/source/blender/nodes/shader/node_shader_tree.c +++ b/source/blender/nodes/shader/node_shader_tree.c @@ -844,7 +844,7 @@ void ntreeGPUMaterialNodes(bNodeTree *localtree, GPUMaterial *mat, bool *has_sur ntree_shader_tag_nodes(localtree, output, &tags); exec = ntreeShaderBeginExecTree(localtree); - ntreeExecGPUNodes(exec, mat, 1); + ntreeExecGPUNodes(exec, mat, output); ntreeShaderEndExecTree(exec); /* EEVEE: Find which material domain was used (volume, surface ...). */ diff --git a/source/blender/nodes/shader/node_shader_util.c b/source/blender/nodes/shader/node_shader_util.c index cc2032a7ba5..19bfd755928 100644 --- a/source/blender/nodes/shader/node_shader_util.c +++ b/source/blender/nodes/shader/node_shader_util.c @@ -201,7 +201,7 @@ bNode *nodeGetActiveTexture(bNodeTree *ntree) return inactivenode; } -void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, int do_outputs) +void ntreeExecGPUNodes(bNodeTreeExec *exec, GPUMaterial *mat, bNode *output_node) { bNodeExec *nodeexec; bNode *node; @@ -220,7 +220,7 @@ 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)) + if ((output_node != NULL) && (node == output_node)) do_it = true; } else { diff --git a/source/blender/nodes/shader/node_shader_util.h b/source/blender/nodes/shader/node_shader_util.h index 1eca3b8721e..e457f2f8b56 100644 --- a/source/blender/nodes/shader/node_shader_util.h +++ b/source/blender/nodes/shader/node_shader_util.h @@ -88,6 +88,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, struct bNode *output_node); #endif diff --git a/source/blender/nodes/shader/nodes/node_shader_common.c b/source/blender/nodes/shader/nodes/node_shader_common.c index 8596c770c62..b9c9093a065 100644 --- a/source/blender/nodes/shader/nodes/node_shader_common.c +++ b/source/blender/nodes/shader/nodes/node_shader_common.c @@ -207,7 +207,7 @@ static int gpu_group_execute(GPUMaterial *mat, bNode *node, bNodeExecData *execd return 0; group_gpu_copy_inputs(node, in, exec->stack); - ntreeExecGPUNodes(exec, mat, 0); + ntreeExecGPUNodes(exec, mat, NULL); group_gpu_move_outputs(node, out, exec->stack); return 1; -- cgit v1.2.3