-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Closed
Closed
Copy link
Labels
Milestone
Description
Description
#31459 introduced automatic use of toVar(), but assignments to swizzled nodes don't seem to be supported and result in malformed code without explicit calls to toVar(). This might be more of a feature request.
Examples
outputNode = Fn(() => {
const a = vec3()
a.zyx.assign(vec3(0, 1, 2))
return a
})()is transpiled to:
var nodeVar0 : vec3<f32>;
nodeVar0 = vec3<f32>( 0.0, 1.0, 2.0 );
vec3<f32>( 0.0, 0.0, 0.0 ).z = nodeVar0[ 0 ];
vec3<f32>( 0.0, 0.0, 0.0 ).y = nodeVar0[ 1 ];
vec3<f32>( 0.0, 0.0, 0.0 ).x = nodeVar0[ 2 ];
output.color = vec4<f32>( vec3<f32>( 0.0, 0.0, 0.0 ), 1.0 );Reproduction steps
- Open the fiddle and see the output in the bottom right pane.
Code
See the code in the description and the fiddle below.
Live example
https://jsfiddle.net/shotamatsuda/qh4kasxb/
Screenshots
No response
Version
r179
Device
Desktop
Browser
Chrome
OS
MacOS