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

Add option to output multiple files, one per entry point #539

Closed
khyperia opened this issue Mar 25, 2021 · 0 comments · Fixed by #551
Closed

Add option to output multiple files, one per entry point #539

khyperia opened this issue Mar 25, 2021 · 0 comments · Fixed by #551
Assignees
Labels
t: enhancement A new feature or improvement to an existing one.

Comments

@khyperia
Copy link
Contributor

Discussed in #524

Right now, the ecosystem for SPIR-V is quite buggy when handling multiple entry points per spir-v module. We've fought it a lot, but it's time to give up 🔥 and add an option to emit multiple files per crate, one entry point per file.

  1. Add an option to spirv-builder to let the user specify that they want multiple files
  2. Plumb that through to rust-gpu
  3. Near the end of linking (before ID compaction? idk), clone the module N times, where N is the number of entry points. In each one, remove all but one entry point, then run DCE on it.
  4. Output the collection of files somewhere(?). @eddyb said that there's pre-existing code to translate a rust name (e.g. foo::bar) to a filesystem-okay path in MIR dumping, we should re-use that.
  5. Return a HashMap<function name, Path> from spirv-builder to the user ✨somehow✨. @eddyb had the idea of making the rustc artifact actually be a json file that contains that map, and then spirv-builder would read that json and return that map.
@khyperia khyperia added the t: enhancement A new feature or improvement to an existing one. label Mar 25, 2021
@khyperia khyperia self-assigned this Mar 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t: enhancement A new feature or improvement to an existing one.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant