fxc.exe: compilation aborted unexpectedly

Started by
3 comments, last by cozzie 5 years ago

Hello,

I wanted to compile a DX11 shader (model cs_5_0) with fxc that comes with the DirectX SDK June (2010), I need to use that SDK for the time being due to distribution problem

But the compilation terminates unexpectedly.

My CPU is i7 6500U with HD 5200, it supports shader model 5.1 and DirectX 12, I am not sure if that supports compute shader 5.0

I tried to compile the compute shader using the shader model 5.0 (fx_5_0), it compiles and didn't work as expected.

So I thought I still I need to compile that shader using compute shader model 5.0

Does my CPU support cs_5_0?

Thanks

Jack

Advertisement

Shader model 5.1 and DirectX 12 must support compute shaders. But if you are getting a compile error, then that's not related, because the fxc compiler doesn't care what your GPU is (it is run on the CPU). Are you getting any error or it just crashes? You mentioned that you are trying to compile with fx_5_0, but the proper flag for compute shader would be cs_5_0 instead. 

Here are the docs for fxc compiler syntax: https://docs.microsoft.com/en-us/windows/desktop/direct3dtools/dx-graphics-tools-fxc-syntax

10 hours ago, lucky6969b said:

I need to use that SDK for the time being due to distribution problem

If necessary, you can offline-compile your shaders. Meaning, you'd only need one machine that has an updated SDK to get a newer version of fxc.exe so that you can compile your shaders into a header file or cso file. And if you're only having this problem for compute shaders, you could even keep the rest of your shaders going through whatever system you have (build-time or run-time, though hopefully not run-time) and just offline compile the ones that are problematic for you.

I'm pretty sure that the root of your problem is your old version of fxc. You could also use d3dcompiler_47.dll which is included in the OS since Windows 8 to compile your shaders using the D3DCompile function. You could either do it at runtime, or using a helper utility which invokes it instead of using fxc.

My few cents; did you try another shader compiler to see if that gives any errors? Could be any random one, supporting SM5.1 (note that some other compilers might use FXC 'under the hood').

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

This topic is closed to new replies.

Advertisement