Open vlj opened 7 years ago
glslc's HLSL support is not yet complete.
glslc inherits the behaviours of Glslang.
Glslang's dialect of HLSL allows layout(set=
For Glslang's test case see https://github.com/KhronosGroup/glslang/blob/master/Test/hlsl.layout.frag and corresponding AST intermediate and SPIR-V assembly: https://github.com/KhronosGroup/glslang/blob/master/Test/baseResults/hlsl.layout.frag.out
Note that glslangValidator supports several options to automatically map bindings, and to "shift" binding numbers for UBOs, images, textures, and samplers. I plan to add those options to glslc as well.
@dneto0 Are there any plans to add support of RootSignature in GLSLC for converting bindings. In HLSL bindings are taken from the RootSignature. Can we add this option in GLSLC to support it.
We rely on Glslang for HLSL compilation. So if Glslang exposes RootSignature support then Shaderc would get it. However, I don't think anybody else has asked for that.
@dneto0 Ok .thanks for the info. For now, I have added my own preprocessing step, where I read the rootSignature myself and parse the bindings and then change the register numbers before getting it converted to SPIRV through GLSLC.
I am seeing another issue though if you can comment on that: I had a simple HLSL shader having separate texture2d and sampler ... I converter this to SPIRV through glslc. It works fine on Windows but Android fails to createpipeline for this... (strange that its same code on windows)... Can this be due to driver issue ? Any clues ?
I'm no expert in the API. Could it just be driver differences? For example, make sure that the selected image format is supported on both.
glslc is able to build hlsl shader but it's not obvious how to describe descriptor layout. I'm not sure if it's possible to embed a root signature and how it maps to vulkan layouts.