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

Minifier mangles the texture2D keyword #21

Open
adamvleggett opened this issue Apr 24, 2024 · 2 comments
Open

Minifier mangles the texture2D keyword #21

adamvleggett opened this issue Apr 24, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@adamvleggett
Copy link

For WebGL 1 shaders, we still need texture2D, but it appears the mangler is renaming this keyword.

@arcman7
Copy link

arcman7 commented Jul 22, 2024

For WGSL
It also:

  • mangles variable names into reserved keywords such as "as"
  • mangles "1e-6" into "1e -6" (same for 1e+6)
  • possibly adds an extra comma to the last argument in a list of arguments to a function

But otherwise it works fine for me

@CodyJasonBennett
Copy link
Owner

I think that is largely fixed by re-implementing the minifier with the new AST (WGSL is still WIP there #20). It currently only uses the tokenizer and a few meticulously crafted heuristics for a mostly correct result, but not correct enough to be stable (basic whitespace collapse is fine though). WebGL1 is different since I need to add new keywords for minification but don't close the door for validation later.

@CodyJasonBennett CodyJasonBennett added the bug Something isn't working label Jul 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants