Closed tklajnscek closed 4 years ago
I've met the same problem. And this works for me when I try to use it for es 300 in WebGL2 since Separate Shader Objects feature is not supported until 310.
Thanks. I'll add your change. It looks like appending descriptor binding info into uniform names is a temporally workaround for extracting information. It can be replaced by a future reflection APIs.
I have to remove the appending descriptor binding info into uniform names. Because the spv::Decoration::DecorationBinding is different on macOS. The test can't pass with it.
A regression happens after update the SPIRV-Cross. The "in_var_xxx" is changed to "in.var.xxx". Need to adopt this change.
Is your feature request related to a problem? Please describe. My engine supports GLES2 / WebGL1 in addition to newer OpenGL versions and Vulkan/DX12/Metal. By default, the shaders generated don't play well with the legacy GLSL versions. Since it's still a major target, I suggest some improvements & conventions to make it work out of the box.
Describe the solution you'd like I suggest two improvements using SPRIVCross's shader reflection API:
Describe alternatives you've considered The minor changes I propose should cover most of the use cases, but there might be a way to do this more generically with callbacks etc, although I feel it would go against the super streamlined design of ShaderConductor and would leak implementation details into user code.
Additional context This is the code I'm using currently in ConvertBinary():