question

55634029 avatar image
0 Votes"
55634029 asked 55634029 commented

When compile HLSL shader model5.1, get error X3506: unrecognized compiler target 'vs_5_1'

Hello, I'm working on HLSL shaders with some new features of shader model 5.1. I use D3DCompileFromFile to compile the shader using target "vs_5_1". It actually works well on my laptop, but when it turns to my desktop computer, it gets an exception : "get error X3506: unrecognized compiler target 'vs_5_1'".

I think that might because the "d3dcompiler_47.dll" in "Windows32" folder is too old, it seems that my laptop gets a newer version, but it's actually difficult to replace the file as it is always used by "dwm.exe".

Is this problem solvable? Or it just means my hardware does not support version 5_1? I specified D3D_FEATURE_LEVEL_12_0 when creating the device and it supports the feature level. I think as it's a compile error it should just be a software problem but I cannot find out how to solve it.

vs-debugging
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

55634029 avatar image
0 Votes"
55634029 answered 55634029 commented

I finally solve the problem, I took two steps:
1. replace the d3dcompiler_47.dll with the newer version
2. remove the project and pull it from git again, then build

I have no idea which step actually fixes the problem, maybe both.

I first replace the .dll but it still doesn't work.
The hint is that I start a new project and only try to compile the shader, and find it actually works well.
So I rebuild my project, and luckily it works!

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

I finally realize the problem, it actually due to Qt.
When I call windeployqt, it actually generates an old-version "D3DCompiler_47.dll" for me in debug directory.
And that's the problem, just delete it, everything is gonna be fine.

0 Votes 0 ·