Blender  V3.3
node_exec.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2007 Blender Foundation. All rights reserved. */
3 
8 #pragma once
9 
10 #include "DNA_listBase.h"
11 
12 #include "BLI_utildefines.h"
13 
14 #include "BKE_node.h"
15 
16 #include "node_util.h"
17 
18 #include "RNA_types.h"
19 
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23 
24 struct bNode;
25 struct bNodeStack;
26 struct bNodeTree;
27 
28 /* Node execution data */
29 typedef struct bNodeExec {
31  struct bNode *node;
33 
37 
38 /* Execution Data for each instance of node tree execution */
39 typedef struct bNodeTreeExec {
40  struct bNodeTree *nodetree; /* backpointer to node tree */
41 
42  int totnodes; /* total node count */
43  struct bNodeExec *nodeexec; /* per-node execution data */
44 
45  int stacksize;
46  struct bNodeStack *stack; /* socket data stack */
47  /* only used by material and texture trees to keep one stack for each thread */
48  ListBase *threadstack; /* one instance of the stack for each thread */
50 
51 /* stores one stack copy for each thread (material and texture trees) */
52 typedef struct bNodeThreadStack {
54  struct bNodeStack *stack;
55  bool used;
57 
59 struct bNodeStack *node_get_socket_stack(struct bNodeStack *stack, struct bNodeSocket *sock);
60 void node_get_stack(struct bNode *node,
61  struct bNodeStack *stack,
62  struct bNodeStack **in,
63  struct bNodeStack **out);
64 
66  struct bNodeTree *ntree,
67  bNodeInstanceKey parent_key);
68 void ntree_exec_end(struct bNodeTreeExec *exec);
69 
70 #ifdef __cplusplus
71 }
72 #endif
void(* NodeFreeExecFunction)(void *nodedata)
Definition: BKE_node.h:207
These structs are the foundation for all linked lists in the library system.
OperationNode * node
bNodeTree * ntree
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
void node_get_stack(struct bNode *node, struct bNodeStack *stack, struct bNodeStack **in, struct bNodeStack **out)
Definition: node_exec.cc:36
struct bNodeStack * node_get_socket_stack(struct bNodeStack *stack, struct bNodeSocket *sock)
Definition: node_exec.cc:28
struct bNodeThreadStack bNodeThreadStack
struct bNodeExec bNodeExec
struct bNodeTreeExec * ntree_exec_begin(struct bNodeExecContext *context, struct bNodeTree *ntree, bNodeInstanceKey parent_key)
Definition: node_exec.cc:139
struct bNodeTreeExec bNodeTreeExec
void ntree_exec_end(struct bNodeTreeExec *exec)
Definition: node_exec.cc:242
static void exec(void *data, int UNUSED(thread), bNode *node, bNodeExecData *execdata, bNodeStack **in, bNodeStack **out)
bNodeExecData data
Definition: node_exec.h:32
NodeFreeExecFunction free_exec_fn
Definition: node_exec.h:35
struct bNode * node
Definition: node_exec.h:31
struct bNodeThreadStack * prev
Definition: node_exec.h:53
struct bNodeThreadStack * next
Definition: node_exec.h:53
struct bNodeStack * stack
Definition: node_exec.h:54
struct bNodeExec * nodeexec
Definition: node_exec.h:43
struct bNodeStack * stack
Definition: node_exec.h:46
struct bNodeTree * nodetree
Definition: node_exec.h:40
ListBase * threadstack
Definition: node_exec.h:48