Skip to content

Commit bc7aedd

Browse files
authored
TSL: Fix debug() changes the compiled code (#30944)
* fix `build()` return value * add `webgpu_postprocessing_fxaa` unknown problem * update description
1 parent 09826c0 commit bc7aedd

File tree

3 files changed

+10
-5
lines changed

3 files changed

+10
-5
lines changed

src/nodes/core/Node.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -586,12 +586,14 @@ class Node extends EventDispatcher {
586586
}
587587

588588
/**
589-
* This method performs the build of a node. The behavior of this method as well as its return value depend
590-
* on the current build stage (setup, analyze or generate).
589+
* This method performs the build of a node. The behavior and return value depend on the current build stage:
590+
* - **setup**: Prepares the node and its children for the build process. This process can also create new nodes. Returns the node itself or a variant.
591+
* - **analyze**: Analyzes the node hierarchy for optimizations in the code generation stage. Returns `null`.
592+
* - **generate**: Generates the shader code for the node. Returns the generated shader string.
591593
*
592594
* @param {NodeBuilder} builder - The current node builder.
593-
* @param {?string} output - Can be used to define the output type.
594-
* @return {?string} When this method is executed in the setup or analyze stage, `null` is returned. In the generate stage, the generated shader string.
595+
* @param {?string} [output=null] - Can be used to define the output type.
596+
* @return {Node|string|null} The result of the build process, depending on the build stage.
595597
*/
596598
build( builder, output = null ) {
597599

@@ -657,6 +659,8 @@ class Node extends EventDispatcher {
657659

658660
}
659661

662+
result = properties.outputNode || null;
663+
660664
} else if ( buildStage === 'analyze' ) {
661665

662666
this.analyze( builder );

src/nodes/gpgpu/ComputeNode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ class ComputeNode extends Node {
165165

166166
setup( builder ) {
167167

168-
const result = this.computeNode.setup( builder );
168+
const result = this.computeNode.build( builder );
169169

170170
if ( result ) {
171171

test/e2e/puppeteer.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ const exceptionList = [
168168
'webgpu_materials_envmaps_bpcem',
169169
'webgpu_postprocessing_sobel',
170170
'webgpu_postprocessing_3dlut',
171+
'webgpu_postprocessing_fxaa',
171172
'webgpu_postprocessing_afterimage',
172173
'webgpu_xr_native_layers',
173174

0 commit comments

Comments
 (0)