3

嘿,我收到此错误:
错误 X3086:DX9 样式的“编译”语法在严格模式下已弃用
使用此代码编译 Directx 效果时:

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

我很确定它在抱怨这个:

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

那么我应该使用什么来代替编译呢?

4

1 回答 1

2

尝试:

technique11 basic
{
    pass p0
    {
        SetVertexShader( CompileShader( vs_5_0, vsMain() ) );
        SetPixelShader( CompileShader( ps_5_0, psMain() ) );
    }
}
于 2010-11-19T14:04:10.707 回答