问题来源

在研究HLSL时编译一个demo出现了error X3539的问题

DirectX using C++_error X3539:ps1_x is no longer supported...解决方案

 

解决方案

将代码中的ps_1_1 改为ps_2_0

PixelShader = compile ps_1_1 PS();

  

或者是在D3DXCompileShaderFromFile函数中将对应的ps_1_1改为ps_2_0

//create pixel shader
ID3DXBuffer* codeBuffer        = 0;
ID3DXBuffer* errorBuffer       = 0;
HRESULT hr = D3DXCompileShaderFromFile("ps.txt",
                                       0,
                                       0,
                                       "PS_Main", // entry point function name
                                       "ps_2_0",  //ps_1_1 is error X3539
                                       D3DXSHADER_DEBUG,
                                       &codeBuffer,
                                       &errorBuffer,
                                       &pixelConstTable);

 

最后渲染出来的结果

DirectX using C++_error X3539:ps1_x is no longer supported...解决方案

demo源码地址

 

参考资料

DX C++ error X3539_Stackoverflow

 

相关文章:

  • 2021-08-15
  • 2021-04-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-13
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2021-09-12
相关资源
相似解决方案