嘿,
我收到此错误:
错误 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();
}
}
那么我应该使用什么来代替编译呢?
最佳答案
尝试:
technique11 basic
{
pass p0
{
SetVertexShader( CompileShader( vs_5_0, vsMain() ) );
SetPixelShader( CompileShader( ps_5_0, psMain() ) );
}
}
关于directx - HLSL 错误 X3086 : DX9-style 'compile' syntax is deprecated in strict mode,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4200777/