FX-File HLSL performance

Started by
7 comments, last by Climax 17 years, 4 months ago
Hi Does using FX-files decrease or increase performance? Or is it the same if I just compile the HLSL shaders manually and call the renderstates and SetPixel/VertexShader etc. hardcoded? Did that sound ambiguous? :P I just get the idea that the Effect API has too much CPU overhead? Thanx
Advertisement
The HLSL shader compilation isn't that quick, but it only has to take place at load-time, so even if it takes a second or two, that isn't much of an issue.

The Effect Framework's runtime methods (Begin, BeginPass, SetFloat, etc) are decently efficient. Theres no reason to look at them for speed improvements unless they start showing up in profiles, which is unlikely.

Overall, using the Effect Framework and HLSL shaders should have minimal effect on the actual performance of the application, if at all.

Hope this helps.
Sirob Yes.» - status: Work-O-Rama.
Yeah I guess you're right! Would have had to compile it eitherway!

Thanks!
In the case you run in a load time problem you can precompile effects files. The binary format could be used to create an effect much faster.
Quote:Original post by Demirug
In the case you run in a load time problem you can precompile effects files. The binary format could be used to create an effect much faster.


Do I use fxc.exe from the SDK?
Yes, this is one option.
You could use the ID3DXEffectCompiler Interface too.
One more question...

In my FX-file, do I still use this code (referring to 'compile' keyword)? :

VertexShader = compile vs_2_0 mainVS();
PixelShader = compile ps_2_b mainPS();
Sure, the FX File Parser/Compiler still need this information.
Great thanx!

This topic is closed to new replies.

Advertisement