I'm writing a voxel engine in C++, and I'm implementing a Vulkan renderer. I've decided to write shaders in HLSL, and translate them via SPIRV-Cross. However, this brings me to a problem - glslang's HLSL compiler does not allow samplers. For example, this pixel shader:
uniform sampler2D tex;
float4 main(float2 uv : TEXCOORD0) : COLOR0 {
return tex2D(tex, uv);
}
gives this compiler output:
Expected Sampled Image to be of type OpTypeSampledImage
%19 = OpImageSampleImplicitLod %v4float %17 %18
I don't know if I should write my shaders in GLSL, or use a different library. Any help would be appreciated.