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 a preserve_bindings opt to the builder and codegen opts #830

Merged
merged 4 commits into from
Jan 3, 2022

Conversation

expenses
Copy link
Contributor

@expenses expenses commented Dec 20, 2021

This resolves #827 and makes reflection a lot easier. I think having it set to true unconditionally is the right move but two alternatives are:

* Setting it to cg_args.spirv_metadata != SpirvMetadata::None. This is pretty unclear behaviour but it does keep things the same in the default case.

  • Adding a new CodegenArgs::opt_preserve_bindings argument. Adds more complexity and is easily missed. Doesn't really 'just work'.

@khyperia
Copy link
Contributor

I think the best option here is the second alternative: adding a new option to spirv-builder. Removing unused bindings is the default of other shader compilers, as well as a lot of tooling, and is usually the desired behavior AFAIK. Adding an option for alternate use cases seems like the way to go.

@expenses expenses changed the title Set spirv_tools::opt::Options::preserve_bindings to true unconditionally @expenses Add a preserve_bindings opt to the builder and codegen opts Jan 1, 2022
@expenses
Copy link
Contributor Author

expenses commented Jan 1, 2022

@khyperia done.

@expenses expenses changed the title @expenses Add a preserve_bindings opt to the builder and codegen opts Add a preserve_bindings opt to the builder and codegen opts Jan 1, 2022
…r lines above, making the styling of the file fairly inconsistent. Well, whatever.
Copy link
Contributor

@khyperia khyperia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

@khyperia khyperia merged commit d705a23 into EmbarkStudios:main Jan 3, 2022
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.

DCE shouldn't remove unused descriptors
2 participants