We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When nesting If- and Else-nodes in TSL, the code compilation gets messed up.
Consider for example the following TSL code:
const foo = float(1).mul(2); const result = float(0).toVar(); If( instanceIndex.equal(uint(0)), () => { result.assign( foo ); } ).Else( () => { If( instanceIndex.equal(uint(1)), () => { result.assign( foo ); } ).Else( () => { result.assign( foo ); } ); } ); outputBuffer.element(instanceIndex).assign(result);
Here it is clear that every element of the outputBuffer should be set to 1*2=2, the initial value of variable foo.
However, it gets transpiled to the following wgsl code:
// #--- TSL debug - compute shader ---# nodeVar0 = 0.0; if ( ( instanceIndex == 0u ) ) { nodeVar0 = ( 1.0 * 2.0 ); } else { if ( ( instanceIndex == 1u ) ) { nodeVar1 = ( 1.0 * 2.0 ); nodeVar0 = nodeVar1; } else { nodeVar0 = nodeVar1; } } NodeBuffer_529.value[ instanceIndex ] = nodeVar0;
Where nodeVar0 gets set to an uninitialized nodeVar1 for every instanceIndex except 0 and 1.
This breaks for example the mx_hsvtorgb() function in the current release r176.
See the attached jsfiddle for a live example.
No response
r176-dev
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
When nesting If- and Else-nodes in TSL, the code compilation gets messed up.
Consider for example the following TSL code:
Here it is clear that every element of the outputBuffer should be set to 1*2=2, the initial value of variable foo.
However, it gets transpiled to the following wgsl code:
Where nodeVar0 gets set to an uninitialized nodeVar1 for every instanceIndex except 0 and 1.
This breaks for example the mx_hsvtorgb() function in the current release r176.
See the attached jsfiddle for a live example.
Live example
Screenshots
No response
Version
r176-dev
The text was updated successfully, but these errors were encountered: