-
-
Notifications
You must be signed in to change notification settings - Fork 34
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
C# API #314
Comments
I'd love this. Maybe it would be also possible to expose an API to the AST? |
What would you like to do with the AST? I'd like to be cautious. If we expose too much, we won't be able to keep the API stable. |
I had a tool in mind for some time that performs a file size optimization on a specific intro using a global optimization technique (like CMA-ES). The optimization parameter space would be "shaders that produce identical results on screen", the cost function would be "build the intro with a specific shader, link it with a compressing linker and determine the file size." So the task in the first step would be to generate shaders from an existing input shader with all the identical source transformations that do not change the shader output; like reordering independent nodes (for example independent elements of initializer lists or independent statements, functions, ...). While it is perfectly possible to achieve with a separate parser/rewriter and using the shader_minifier executable in the cost function, it would be much cleaner to use shader_minifier's AST for this imho.
I agree. Maybe just using the executable is the way :) |
This sounds like a feature that should be built inside Shader Minifier. |
that would be even cooler! :) |
The C# is very simple; feel free to file new feature requests as needed. |
We could provide a better, documented API usable from C#. This would help tools minify code without having to call the .exe (and saving content to disk and parsing error messages).
The text was updated successfully, but these errors were encountered: