shaderc icon indicating copy to clipboard operation
shaderc copied to clipboard

Shaderc as library for glsl / hlsl -> optimized SPIR-V with reflection

Open Sairony opened this issue 6 years ago • 1 comments

It would seem libshaderc is the way to go, but it doesn't seem to possible to produce this combination.

In games, at least for desktop, one usually have some sort of material system which produces different permutations depending on user settings & hardware, as such one can't ship SPIR-V. It doesn't make sense to spawn a new process of glslangValidator then, optimization on / off is a given.

Sairony avatar Jan 31 '18 10:01 Sairony

Currently libshaderc is only a compilation API. It does not produce reflection information as a side effect of compilation. Experience with HLSL compilation through Glslang shows that Glslang's reflection API is not accurate since HLSL "legalization" transforms will throw away bindings, and so the reflection information is out of date.
The plan is to write a standalone API & utility in SPIRV-Tools to do reflection on a SPIR-V module in isolation. See https://github.com/KhronosGroup/SPIRV-Tools/issues/859

dneto0 avatar Jan 31 '18 20:01 dneto0