Change set order of imported and local ParameterBlocks on slangc? #11185
Replies: 1 comment 2 replies
-
|
I completely understand where you’re coming from with this request, but I’m wary of keeping on piling more complexity (options, flags, etc.) on top of For folks who are reluctant to switch to using the compilation API, I’d be interested to know: what are the sticking points that make you reluctant? If we provided something like a high-quality Python API that could be used to orchestrate Slang compilation, would that change anything? On the specific topic at hand, my honest answer is that the best way to address the problem is to switch away from pervasive use of global-scope shader parameters declared in modules that get imported. In practice, global-scope shader parameters are akin to global variables or singletons: usually an anti-pattern or “code smell,” unless clearly justified. You can get better control over the exact layout of things by either declaring all the parameter blocks you want as entry-point parameters, or by declaring them at global scope… but only in the same modules that directly declare the entry points (and which are not imported anywhere else). |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I posted this on the discord, but I figured maybe here it would get more visibility.
Currently, giving this input to slangc:
Produces these global parameter bindings on the reflection JSON:
I would like to change the bindings so that the imported parameters are assigned first over the locally declared ones. If I'm reading the docs correctly, it should be possible to do it through the compilation API:
But I would rather not go into the API at this time. Is there a way to do it through slangc? Preferably without having to manually add explicit bindings to the parameters.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions