shaderc
shaderc copied to clipboard
Auto specialization constant IDs
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_id
s 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_id
s, 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.
This first has to start as a feature in Glslang. Then we can pipe it through to Shaderc.
Oh, really? I did not know. Where should I then forward my message?