Changeset View
Changeset View
Standalone View
Standalone View
source/blender/nodes/shader/nodes/node_shader_common.cc
| Show All 37 Lines | for (bNode *node : ngroup->all_nodes()) { | ||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| /* Copy internal results to the external outputs. | /* Copy internal results to the external outputs. | ||||
| */ | */ | ||||
| static void group_gpu_move_outputs(bNode *gnode, GPUNodeStack *out, bNodeStack *gstack) | static void group_gpu_move_outputs(bNode *gnode, GPUNodeStack *out, bNodeStack *gstack) | ||||
| { | { | ||||
| bNodeTree *ngroup = (bNodeTree *)gnode->id; | if (!gnode->id) { | ||||
| return; | |||||
| } | |||||
| for (bNode *node : ngroup->all_nodes()) { | const bNodeTree &ngroup = *reinterpret_cast<bNodeTree *>(gnode->id); | ||||
| if (node->type == NODE_GROUP_OUTPUT && (node->flag & NODE_DO_OUTPUT)) { | ngroup.ensure_topology_cache(); | ||||
| int a; | |||||
| LISTBASE_FOREACH_INDEX (bNodeSocket *, sock, &node->inputs, a) { | const bNode *group_output_node = ngroup.group_output_node(); | ||||
| bNodeStack *ns = node_get_socket_stack(gstack, sock); | |||||
| if (!group_output_node) { | |||||
| return; | |||||
| } | |||||
| int a = 0; | |||||
| LISTBASE_FOREACH_INDEX (bNodeSocket *, socket, &group_output_node.inputs, a) { | |||||
| bNodeStack *ns = node_get_socket_stack(gstack, socket); | |||||
| if (ns) { | if (ns) { | ||||
| /* convert the node stack data result back to gpu stack */ | /* convert the node stack data result back to gpu stack */ | ||||
| node_gpu_stack_from_data(&out[a], sock->type, ns); | node_gpu_stack_from_data(&out[a], socket->type, ns); | ||||
| } | |||||
| } | |||||
| break; /* only one active output node */ | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| static int gpu_group_execute( | static int gpu_group_execute( | ||||
| GPUMaterial *mat, bNode *node, bNodeExecData *execdata, GPUNodeStack *in, GPUNodeStack *out) | GPUMaterial *mat, bNode *node, bNodeExecData *execdata, GPUNodeStack *in, GPUNodeStack *out) | ||||
| { | { | ||||
| bNodeTreeExec *exec = static_cast<bNodeTreeExec *>(execdata->data); | bNodeTreeExec *exec = static_cast<bNodeTreeExec *>(execdata->data); | ||||
| ▲ Show 20 Lines • Show All 48 Lines • Show Last 20 Lines | |||||