-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
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
Add label and temp functions to ShaderNode #23546
Conversation
@LeviPesin do you think we got another name for it? Maybe |
I actually think that makeVar is better, because it should be mainly used to create a new variable from a value to stop it from recalculating in further calculations (e.g. something like |
I think that About // 1. force variable creation
const four = temp( add( 2, 2 ) );
// 2. define a var name in NodeBuilder -> GLSL or WGSL
label( four, 'FOUR' );
// 3. create a named variable
const four = label( add( 2, 2 ), 'FOUR' ); |
I like this approach!
Here is an example: |
@LeviPesin It seems that exist some conflicts in this PR. |
This shouldn't happen, I will investigate. |
@sunag I think I resolved the conflicts. |
Thanks! :) |
* Add makeVar function to ShaderNode * Fix * Update VarNode * Update makeVar * Add temp and label functions * Refactor label function * Try to resolve merge conflicts * Try to resolve merge conflicts * Try to resolve merge conflicts * Try to resolve merge conflicts
@sunag Is there any progress on fixing this example? Should I make a new issue for it? |
* Add makeVar function to ShaderNode * Fix * Update VarNode * Update makeVar * Add temp and label functions * Refactor label function * Try to resolve merge conflicts * Try to resolve merge conflicts * Try to resolve merge conflicts * Try to resolve merge conflicts
Related issue: - (mentioned in #23534)
Description
This PR adds the label and temp functions to the ShaderNode.