Jump to content

  • Log In with Google      Sign In   
  • Create Account

how to let the system manage 'effect'


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
2 replies to this topic

#1 tcige   Members   -  Reputation: 206

Like
0Likes
Like

Posted 11 June 2013 - 10:26 AM

i create the effect using D3DXCreateEffectFromFile, but it must be release before Reset

 

so how to let the system manage it, like putting D3DPOOL_MANAGED when calling CreateVertexBuffer



Sponsor:

#2 belfegor   Crossbones+   -  Reputation: 2716

Like
5Likes
Like

Posted 11 June 2013 - 10:48 AM

You don't release it on reset, you need to call ID3DXEffect::OnLostDevice before and  ID3DXEffect::OnResetDevice after reset.



#3 mhagain   Crossbones+   -  Reputation: 8276

Like
2Likes
Like

Posted 11 June 2013 - 02:29 PM

You don't release it on reset, you need to call ID3DXEffect::OnLostDevice before and  ID3DXEffect::OnResetDevice after reset.

 

This is correct.

 

An Effect in D3D9 consists of vertex shaders, pixel shaders, state blocks and a whole load of CPU-side code.  In D3D9 shaders will survive a lost device, but state blocks are one of those object classes that must be destroyed and recreated, so presumably that's what the Effect OnLostDevice/OnResetDevice calls do.


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.





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