link-time constants in reflection API #5709
Labels
SPF:Proposal
Slang Proposed Feature: Proposal - A Slang feature which has been proposed, but not yet implemented
Milestone
Hi,
As discussed in #5664 (comment), I think it would be nice to be able to get a list of available link-time constants 'parameters', for example to generate shader permutations.
I'm working on a toy game engine, and I was searching for a convenient way to automatically handle shaders permutations.
Looking at the slang syntax, I thought that using link-time constants would be a good idea as it doesn't requires to compile the modules again like the examples provided in the user guide. I would only need to inject a module that set the value for each constant parameter.
Short example :
Slang code : PlayGround Link
Cpp-side :
Currently there is no way to get a list of link-time constants, so I have to manually parse the shader file to retrieve them, which is not a very clean approach.
Also optionally, it would be nice if we can get the default value (which is probable harder to implement)
The text was updated successfully, but these errors were encountered: