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

Auto specialization constant IDs #1335

Open
NikolayKanchevski opened this issue Jun 17, 2023 · 2 comments
Open

Auto specialization constant IDs #1335

NikolayKanchevski opened this issue Jun 17, 2023 · 2 comments

Comments

@NikolayKanchevski
Copy link

Heya, I recently found the functions SetAutoBindUniforms() and SetBindingBase() and I must admit they have been very useful to me. However, I also need such functionality for dealing with specialization constants and there is not one implemented, which is why I decided to write this small issue.

What I propose is adding three more methods - SetAutoMapConstants(bool) (which will search for the following syntax: layout() const Type varName = someValue; and will automatically set the constant_id property for each field), SetConstantsBase(uint) (this one will set the starting constant_id, so, supposing we use SetConstantsBase(10), constant_ids will start from 10 and grow as more fields are present) and SetPreserveConstants(bool) (does the same thing as SetPreserveBindings() - will either remove all specified constant_ids, or not).

It is really just extending the logic of shaderc::CompileOptions to not only work with locations and bindings, but also provide support for specialization constants.

@dneto0
Copy link
Collaborator

dneto0 commented Jun 23, 2023

This first has to start as a feature in Glslang.
Then we can pipe it through to Shaderc.

@NikolayKanchevski
Copy link
Author

NikolayKanchevski commented Jun 23, 2023

Oh, really? I did not know. Where should I then forward my message?

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

2 participants