Extend shader compiler define syntax to allow name=value instead of just valueless defines
Description
Using shader specialization constants to size global arrays doesn't work on the Mac.
We have a need in our vertex shader to size both a vertex attribute array and an array of gl_clipDistance by a defined value at shader compile time. We were using shader specialization constants to achieve this and on Linux and Windows with NVidia and AMD we seemed to have success even though the "Arrays inside a block" discussion in section "4.4.x Specialization-Constant Qualifier" of ARB_gl_spirv.txt made it sound like using specialization constants to size these array members in the shader is not supported. When we tried out the same code on the Mac we had very unreliable results and were not able to get clipping to work correctly if the vertex array or the gl_ClipDistance array was sized by a specialization constant.
Currently, valueless shader compiler defines are added to a std::set<std::string> container via the shader module's hints. This PR extents the syntax to allow name=value without changing the client API thereby providing an option for defines with simple values for use the in the shader code.
Fixes # (issue) #1534
Type of change
Core VSG change
Please delete options that are not relevant.
- [X] New feature (non-breaking change which adds functionality)
How Has This Been Tested?
I extended the vsgclip example in the vsgExamples repository. See vsgExamples pull request 364.
Checklist:
- [X] My code follows the style guidelines of this project
- [X] I have performed a self-review of my own code
- [X] I have commented my code, particularly in hard-to-understand areas
- [X] My changes generate no new warnings
- [X] I have added tests that prove my fix is effective or that my feature works
- [X] Any dependent changes have been merged and published in downstream modules