Question

Hey, I get this error:
error X3086: DX9-style 'compile' syntax is deprecated in strict mode
When compiling a directx effect with this code:

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

I'm pretty sure it's complaining about this:

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

So what am I supposed to use instead of compile?

Was it helpful?

Solution

Try:

technique11 basic
{
    pass p0
    {
        SetVertexShader( CompileShader( vs_5_0, vsMain() ) );
        SetPixelShader( CompileShader( ps_5_0, psMain() ) );
    }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top