Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,649 changes: 0 additions & 1,649 deletions docs/TSL.md

This file was deleted.

Binary file not shown.
11 changes: 9 additions & 2 deletions src/nodes/gpgpu/AtomicFunctionNode.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Node from '../core/Node.js';
import { expression } from '../code/ExpressionNode.js';
import { nodeProxy } from '../tsl/TSLCore.js';
import { error } from '../../utils.js';

/**
* `AtomicFunctionNode` represents any function that can operate on atomic variable types
Expand Down Expand Up @@ -90,11 +91,17 @@ class AtomicFunctionNode extends Node {

generate( builder ) {

const method = this.method;

if ( builder.shaderStage === 'vertex' ) {

error( `TSL: "${this.method}" is not supported in the vertex stage.` );

}

const properties = builder.getNodeProperties( this );
const parents = properties.parents;

const method = this.method;

const type = this.getNodeType( builder );
const inputType = this.getInputType( builder );

Expand Down
15 changes: 12 additions & 3 deletions src/nodes/gpgpu/BarrierNode.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { error } from '../../utils.js';
import Node from '../core/Node.js';
import { nodeProxy } from '../tsl/TSLCore.js';

Expand Down Expand Up @@ -35,15 +36,23 @@ class BarrierNode extends Node {
generate( builder ) {

const { scope } = this;
const { renderer } = builder;
const { renderer, shaderStage } = builder;

const barrierMethod = `${scope}Barrier`;

if ( shaderStage !== 'compute' ) {

error( `TSL: "${barrierMethod}" is not supported in the ${shaderStage} stage and can only be executed in compute.` );

}

if ( renderer.backend.isWebGLBackend === true ) {

builder.addFlowCode( `\t// ${scope}Barrier \n` );
builder.addFlowCode( `\t// ${barrierMethod}() \n` );

} else {

builder.addLineFlowCode( `${scope}Barrier()`, this );
builder.addLineFlowCode( `${barrierMethod}()`, this );

}

Expand Down
2 changes: 1 addition & 1 deletion src/nodes/gpgpu/ComputeBuiltinNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ class ComputeBuiltinNode extends Node {

} else {

warn( `ComputeBuiltinNode: Compute built-in value ${builtinName} can not be accessed in the ${builder.shaderStage} stage` );
warn( `TSL: Compute built-in value "${builtinName}" can not be accessed in the ${builder.shaderStage} stage` );
return builder.generateConst( nodeType );

}
Expand Down
7 changes: 7 additions & 0 deletions src/nodes/gpgpu/SubgroupFunctionNode.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { error } from '../../utils.js';
import TempNode from '../core/TempNode.js';
import { nodeProxyIntent } from '../tsl/TSLCore.js';

Expand Down Expand Up @@ -99,6 +100,12 @@ class SubgroupFunctionNode extends TempNode {

const method = this.method;

if ( builder.shaderStage === 'vertex' ) {

error( `TSL: "${this.method}" is not supported in the vertex shader stage.` );

}

const type = this.getNodeType( builder );
const inputType = this.getInputType( builder );

Expand Down
8 changes: 7 additions & 1 deletion src/nodes/gpgpu/WorkgroupInfoNode.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ArrayElementNode from '../utils/ArrayElementNode.js';
import Node from '../core/Node.js';
import { warn } from '../../utils.js';
import { error, warn } from '../../utils.js';
import StackTrace from '../core/StackTrace.js';

/**
Expand Down Expand Up @@ -209,6 +209,12 @@ class WorkgroupInfoNode extends Node {

generate( builder ) {

if ( builder.shaderStage !== 'compute' ) {

error( 'TSL: "workgroupArray()" can only be executed within the compute shader stage' );

}

const name = ( this.name !== '' ) ? this.name : `${this.scope}Array_${this.id}`;

return builder.getScopedArray( name, this.scope.toLowerCase(), this.bufferType, this.bufferCount );
Expand Down
4 changes: 2 additions & 2 deletions src/nodes/math/MathNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import TempNode from '../core/TempNode.js';
import { sub, mul, div, mod } from './OperatorNode.js';
import { addMethodChaining, nodeObject, nodeProxyIntent, float, vec2, vec3, vec4, Fn } from '../tsl/TSLCore.js';
import { WebGLCoordinateSystem, WebGPUCoordinateSystem } from '../../constants.js';
import { warn } from '../../utils.js';
import { error } from '../../utils.js';

/**
* This node represents a variety of mathematical methods available in shaders.
Expand Down Expand Up @@ -289,7 +289,7 @@ class MathNode extends TempNode {

if ( builder.shaderStage !== 'fragment' && ( method === MathNode.DFDX || method === MathNode.DFDY ) ) {

warn( `TSL: '${ method }' is not supported in the ${ builder.shaderStage } stage.`, this.stackTrace );
error( `TSL: '${ method }' is not supported in the ${ builder.shaderStage } stage.`, this.stackTrace );

method = '/*' + method + '*/';

Expand Down
Loading
Loading