Blender  V2.93
node_exec.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  *
16  * The Original Code is Copyright (C) 2007 Blender Foundation.
17  * All rights reserved.
18  */
19 
24 #pragma once
25 
26 #include "DNA_listBase.h"
27 
28 #include "BLI_utildefines.h"
29 
30 #include "BKE_node.h"
31 
32 #include "node_util.h"
33 
34 #include "RNA_types.h"
35 
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39 
40 struct bNode;
41 struct bNodeStack;
42 struct bNodeTree;
43 
44 /* Node execution data */
45 typedef struct bNodeExec {
47  struct bNode *node;
49 
53 
54 /* Execution Data for each instance of node tree execution */
55 typedef struct bNodeTreeExec {
56  struct bNodeTree *nodetree; /* backpointer to node tree */
57 
58  int totnodes; /* total node count */
59  struct bNodeExec *nodeexec; /* per-node execution data */
60 
61  int stacksize;
62  struct bNodeStack *stack; /* socket data stack */
63  /* only used by material and texture trees to keep one stack for each thread */
64  ListBase *threadstack; /* one instance of the stack for each thread */
66 
67 /* stores one stack copy for each thread (material and texture trees) */
68 typedef struct bNodeThreadStack {
70  struct bNodeStack *stack;
71  bool used;
73 
74 int node_exec_socket_use_stack(struct bNodeSocket *sock);
75 
76 struct bNodeStack *node_get_socket_stack(struct bNodeStack *stack, struct bNodeSocket *sock);
77 void node_get_stack(struct bNode *node,
78  struct bNodeStack *stack,
79  struct bNodeStack **in,
80  struct bNodeStack **out);
81 
83  struct bNodeTree *ntree,
84  bNodeInstanceKey parent_key);
85 void ntree_exec_end(struct bNodeTreeExec *exec);
86 
90  struct bNodeThreadStack *nts,
91  void *callerdata,
92  int thread);
93 
95  struct bNodeTree *ntree,
96  bNodeInstanceKey parent_key);
98 
100  struct bNodeTree *ntree,
101  bNodeInstanceKey parent_key);
103 
104 #ifdef __cplusplus
105 }
106 #endif
void(* NodeFreeExecFunction)(void *nodedata)
Definition: BKE_node.h:202
These structs are the foundation for all linked lists in the library system.
OperationNode * node
bNodeTree * ntree
struct bNodeTreeExec * ntreeShaderBeginExecTree_internal(struct bNodeExecContext *context, struct bNodeTree *ntree, bNodeInstanceKey parent_key)
void ntreeReleaseThreadStack(struct bNodeThreadStack *nts)
Definition: node_exec.cc:305
void node_get_stack(struct bNode *node, struct bNodeStack *stack, struct bNodeStack **in, struct bNodeStack **out)
Definition: node_exec.cc:53
void ntreeShaderEndExecTree_internal(struct bNodeTreeExec *exec)
struct bNodeTreeExec * ntreeTexBeginExecTree_internal(struct bNodeExecContext *context, struct bNodeTree *ntree, bNodeInstanceKey parent_key)
struct bNodeStack * node_get_socket_stack(struct bNodeStack *stack, struct bNodeSocket *sock)
Definition: node_exec.cc:45
struct bNodeThreadStack * ntreeGetThreadStack(struct bNodeTreeExec *exec, int thread)
Definition: node_exec.cc:283
struct bNodeThreadStack bNodeThreadStack
void ntreeTexEndExecTree_internal(struct bNodeTreeExec *exec)
struct bNodeExec bNodeExec
struct bNodeTreeExec * ntree_exec_begin(struct bNodeExecContext *context, struct bNodeTree *ntree, bNodeInstanceKey parent_key)
Definition: node_exec.cc:156
struct bNodeTreeExec bNodeTreeExec
bool ntreeExecThreadNodes(struct bNodeTreeExec *exec, struct bNodeThreadStack *nts, void *callerdata, int thread)
Definition: node_exec.cc:310
void ntree_exec_end(struct bNodeTreeExec *exec)
Definition: node_exec.cc:259
int node_exec_socket_use_stack(struct bNodeSocket *sock)
Definition: node_exec.cc:38
static void exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
struct SELECTID_Context context
Definition: select_engine.c:47
bNodeExecData data
Definition: node_exec.h:48
NodeFreeExecFunction free_exec_fn
Definition: node_exec.h:51
struct bNode * node
Definition: node_exec.h:47
struct bNodeThreadStack * prev
Definition: node_exec.h:69
struct bNodeThreadStack * next
Definition: node_exec.h:69
struct bNodeStack * stack
Definition: node_exec.h:70
struct bNodeExec * nodeexec
Definition: node_exec.h:59
struct bNodeStack * stack
Definition: node_exec.h:62
struct bNodeTree * nodetree
Definition: node_exec.h:56
ListBase * threadstack
Definition: node_exec.h:64