Unity warning about D3D11, but Editor and Project Settings are set to D3D12

I’m wondering why Unity seems to compile D3D11 shaders even though the project is set to D3D12. I found this warning on the Console:

Shader warning in 'MyShader': implicit truncation of vector type at line 413 (on d3d11)

But as you can see in the screenshot below, the Editor and Player Settings are set to Direct3D12 instead:

How comes that Unity is generating a warning about Direct3D11 stuff?

Probably just a hard-coded error message. There is not necessarily a difference how shaders are compiled for DX11 and DX12. DX12 supports a newer HLSL shader model, but you only need that when you are using certain features like ray-tracing. DX12 also supports the new intermediate language DXIL but you can still run DXBC compiled shaders on DX12.

1 Like

@c0d3_m0nk3y is correct. If the shader doesn’t have a #pragma use_dxc or another pragma that forces DXC, we compile it using FXC for both DX11 and DX12, and there’s literally no difference between the two.

2 Likes