Skip to content
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

Compiler Rewrites #43

Open
torinmb opened this issue May 4, 2020 · 1 comment
Open

Compiler Rewrites #43

torinmb opened this issue May 4, 2020 · 1 comment
Assignees
Labels
1.0-base enhancement New feature or request

Comments

@torinmb
Copy link
Member

torinmb commented May 4, 2020

  1. change the binary ops and built-in functions we have to just return the glsl strings rather than appending it to the total source.
  2. make a function in regular js called "createVar(name, value)" or "assignVar(name, value)" which actually creates the line assigning a variable.
  3. using esprima to convert regular assignment statements (ones using any type of = symbol) to the function created in step two.
  4. make tweaks to the branch rewriting we already implemented and any other features we need to update so that they play nice with this new setup.
@torinmb torinmb added enhancement New feature or request 1.0-base labels May 4, 2020
@PWhiddy
Copy link
Member

PWhiddy commented May 5, 2020

Turns out 1 was already supported. For 2, VariableDeclarations can be replaced with makeVar, and overwrite/update "=" type expressions can be replaced with a new "updateVar" function. "For" loops might need a special case here (should for loops be just generated in glsl without unrolling after all? This may be the only way to "break" from loops)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0-base enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants