File tree Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Expand file tree Collapse file tree 1 file changed +15
-4
lines changed Original file line number Diff line number Diff line change 1
- import TempNode from '../core/TempNode .js' ;
1
+ import Node from '../core/Node .js' ;
2
2
import { nodeProxy } from '../tsl/TSLCore.js' ;
3
3
4
4
/**
@@ -10,9 +10,9 @@ import { nodeProxy } from '../tsl/TSLCore.js';
10
10
*
11
11
* This node can only be used with a WebGPU backend.
12
12
*
13
- * @augments TempNode
13
+ * @augments Node
14
14
*/
15
- class AtomicFunctionNode extends TempNode {
15
+ class AtomicFunctionNode extends Node {
16
16
17
17
static get type ( ) {
18
18
@@ -52,6 +52,14 @@ class AtomicFunctionNode extends TempNode {
52
52
*/
53
53
this . valueNode = valueNode ;
54
54
55
+ /**
56
+ * Creates a list of the parents for this node for detecting if the node needs to return a value.
57
+ *
58
+ * @type {boolean }
59
+ * @default true
60
+ */
61
+ this . parents = true ;
62
+
55
63
}
56
64
57
65
/**
@@ -81,6 +89,8 @@ class AtomicFunctionNode extends TempNode {
81
89
82
90
generate ( builder ) {
83
91
92
+ const parents = builder . getNodeProperties ( this ) . parents ;
93
+
84
94
const method = this . method ;
85
95
86
96
const type = this . getNodeType ( builder ) ;
@@ -101,8 +111,9 @@ class AtomicFunctionNode extends TempNode {
101
111
}
102
112
103
113
const methodSnippet = `${ builder . getMethod ( method , type ) } ( ${ params . join ( ', ' ) } )` ;
114
+ const isVoid = parents . length === 1 && parents [ 0 ] . isStackNode === true ;
104
115
105
- if ( b !== null ) {
116
+ if ( isVoid ) {
106
117
107
118
builder . addLineFlowCode ( methodSnippet , this ) ;
108
119
You can’t perform that action at this time.
0 commit comments