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

Tooling: pre-preprocess #include and #ifdefs to reduce shader code size in release build #249

Open
mochaaP opened this issue Feb 13, 2025 · 0 comments

Comments

@mochaaP
Copy link

mochaaP commented Feb 13, 2025

sharing this in case anyone needs a more advanced solution than https://gist.github.com/patriciogonzalezvivo/9a50569c2ef9b08058706443a39d838e:

here's my modified pcpp to make it work better with lygia.
features:

  • depfile, so your favorite build system recognizes when to trigger a rebuild
  • optionally (toggle with --passthru) expands preprocessor directives
  • ignores unnecessary #includes (i.e. "tree-shaking" or "dead code elimination")

pcpp-1.30.tar.gz
5d1004907f0aa61547b31d55cb4f97ae691c5bbfbcc7be25ce585766d167cf16 pcpp-1.30.tar.gz

you can also plug this alongside something like shader-minifier or cembed for use in c/c++ source.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant