Browse Source

TSL: Show shader stage in `debug()` message (#30833)

sunag 9 months ago
parent
commit
d3ca4bec42
1 changed files with 5 additions and 2 deletions
  1. 5 2
      src/nodes/utils/DebugNode.js

+ 5 - 2
src/nodes/utils/DebugNode.js

@@ -41,11 +41,14 @@ class DebugNode extends TempNode {
 		const callback = this.callback;
 		const snippet = this.node.build( builder );
 
+		const title = '--- TSL debug - ' + builder.shaderStage + ' shader ---';
+		const border = '-'.repeat( title.length );
+
 		let code = '';
-		code += '// #--- TSL Debug ---#\n';
+		code += '// #' + title + '#\n';
 		code += builder.flow.code.replace( /^\t/mg, '' ) + '\n';
 		code += '/* ... */ ' + snippet + ' /* ... */\n';
-		code += '// #-----------------#\n';
+		code += '// #' + border + '#\n';
 
 		if ( callback !== null ) {
 

粤ICP备19079148号