Jump to content

  • Log In with Google      Sign In   
  • Create Account

Effect Parameters - Question on Efficiency


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
1 reply to this topic

#1 PhillipHamlyn   Members   -  Reputation: 454

Like
1Likes
Like

Posted 21 July 2012 - 09:50 AM

Hi,

I have read that you should only set effect parameters if they have changed (typically by checking inside your effect wrapper classes get/set blocks) for 'performance reasons'. I'm puzzled as to what those performance benefits are - as I understand it all the textures you might want to pass to the effect are already loaded in the GPU, so the passing of them as a parameter is essentially an instruction to 'select' them, not 'load' them.

In my render loop I sort my artefacts by effect, and then subsort by shared textures. Of course, this cannot always have a single solution set - some artefacts share multiple resources with other artefacts, and there is no 'best' way to sort them from the point of view of the effect having the same parameters from one call to the next. My question is, in general terms, how much effect on performance is incurred by setting a texture to an effect when that is already the last texture the effect used (i.e. shouldn't 'need' resetting).

Phillip

Sponsor:

#2 DJTN   Members   -  Reputation: 207

Like
0Likes
Like

Posted 23 July 2012 - 09:18 AM

The number of drawcalls and state changes is what you have to look out for, performance wise. Basically this is what drives the sort order in most cases.

In older versions of Direct3D, many calls required a context switch, which was expensive, but this isn't true in newer versions.

If it were me, i'd be more concerned with batching (less draw calls) than anything else.

As for your "performance benefits" query, you can try both - using PIX to record the performance and compare.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS