Sign in to follow this  
Climax

FX-File HLSL performance

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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?

Share this post


Link to post
Share on other sites
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();

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this