Replies: 1 comment
-
I applied this fix and worked fine, raised a PR to be merged to bgfx master, read the PR description to clarify: |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi,
shaderc accepts the shader profile via command line switch like this:
` -p, --profile Shader model. Defaults to GLSL.
But the problem is if you pass s_3_0 to s_5_0 the D3DCompile, d3d shader compilers fails with an error as s_... is not a valid target. For HLSL and D3DCompile it should be either vs_3_0 ... vs_5_0 or ps_3_0 ... ps_5_0 or cs_.... so the shader type should also be specified.
For other profiles like vulkan, gl,... this is not an issue,
My suggestion is to keep the profile specifiers consistent, it might be better to apply this change to the first lines of compile function in shaderc_hlsl.cpp:
` static bool compile(const Options& _options, uint32_t _version, const std::string& _code, bx::WriterI* _writer, bool _firstPass)
{
`
I applied this patch to automate the shader compilation from within Visual Studio to build for all platforms at once.
This way it automatically deducts and adds the shader type specifier (v/p/c) and keeps D3DCompile happy, also no need to change the command line switch to vs/ps/...
Any thoughts?
Beta Was this translation helpful? Give feedback.
All reactions