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

Support "Unroll" Loop Control via function-scoped #[spirv(unroll_loops)]. #337

Merged
merged 3 commits into from
Dec 10, 2020

Conversation

eddyb
Copy link
Contributor

@eddyb eddyb commented Dec 10, 2020

This required generalizing the zombie decoration system (see the first commit), because OpLoopMerge (where the Unroll "Loop Control" has to be applied) are created during linking, by the structurizer, not in the original crate (which is the one understanding the mapping between SPIR-V OpFunctions and Rust fns).

It's not as nice as I would've hoped, but because of all the RAUW (Replace All Uses With) happening during linking, we can't just decode all of the decorations eagerly and keep them in e.g. a HashMap, as the IDs being decorated by them won't be replaced by RAUW.

So instead of centralizing such rustc_codegen_spirv decorations into a single enum and HashMap, each type that implements the CustomDecoration trait has to be independently decoded and removed from the SPIR-V module.

@eddyb eddyb requested a review from khyperia December 10, 2020 19:06
@mergify mergify bot merged commit ebf3dbe into EmbarkStudios:main Dec 10, 2020
@eddyb eddyb deleted the funrolls branch December 10, 2020 19:58
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

Successfully merging this pull request may close these issues.

2 participants