在研究HLSL时编译一个demo出现了error X3539的问题git
将代码中的ps_1_1 改成ps_2_0github
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);
最后渲染出来的结果spa
demo源码地址3d