我目前正在学习Vulkan API,是时候创建管道了,我选择了HLSL,因为将来我想在DirectX中重用着色器,当我获得RTX GPU时,我打算带来光线追踪,这是HLSL中的新手,我编写了一个简单的顶点着色器:
float4 main(float2 pos : POSITIONT) : SV_POSITION
{
return float4(pos, 0, 1);
}
在this tutorial之后,我尝试编译:glslc.exe VertexShader.hlsl -o vertex.spv
我收到此错误:glslc: error: 'VertexShader.hlsl': .hlsl file encountered but no -fshader-stage specified ahead
所以,如何在Vulkan中编译HLSL?
Solveld添加-fshader-stage = vertex