Original Post
I understand that the #define D3DXSHADER_USE_LEGACY_D3DX9_31_DLL enable the use of the original Direct3D 9 HLSL compiler from Oct 06. But as far as I can tell it only allows the promotion of ps1.3 shaders to ps2.0. So any clue as to why a ps/vs 3.0 would run around slower when not using this compiler flag? I am using the DirectX 9 effects system and D3DXCreateEffectFromFile() with the flags D3DXFX_NOT_CLONEABLE | D3DXSHADER_USE_LEGACY_D3DX9_31_DLL. Once I remove D3DXSHADER_USE_LEGACY_D3DX9_31_DLL it all slows to a crawl. Setting the flag to 0, or adding D3DXSHADER_OPTIMIZATION_LEVEL3 makes very little difference, I also tried different combinations of flow control also with minimal performance increase. D3DXSHADER_USE_LEGACY_D3DX9_31_DLL seems to be the real winner in this case. My pixel shader does use dynamic branching and removing this code does increase performance a lot when not using D3DXSHADER_USE_LEGACY_D3DX9_31_DLL Its not killing me, because I can happily use this define right now, but just very curious as to what is going on.