HLSL Error X3086: DX9-style Compilation Syntax Deprecated in Strict Mode

Hey, I get this error:
X3086 error: DX9-style compilation syntax is deprecated in strict mode
When compiling the direct effect using this code:

hr=D3DX11CompileFromFile( TEXT("shaders\\basic.fx"), NULL, NULL, NULL,"fx_5_0", D3DCOMPILE_ENABLE_STRICTNESS, 0, NULL, &pBlob, &pErrorBlob, NULL );

I'm sure he complains about this:

technique11 basic
{
 pass p0
 {
  VertexShader = compile vs_5_0 vsMain();
  PixelShader = compile ps_5_0 psMain();
 }
}

So what should I use instead of compiling?

+3
source share
1 answer

Try:

technique11 basic
{
    pass p0
    {
        SetVertexShader( CompileShader( vs_5_0, vsMain() ) );
        SetPixelShader( CompileShader( ps_5_0, psMain() ) );
    }
}
+2
source

Source: https://habr.com/ru/post/1775334/


All Articles