Jump to content
  • Advertisement
Sign in to follow this  
dma42

how to release a handle to an effect parameter block?

This topic is 4889 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, my application shares the ID3DXEffects for multiple objects. Every time I render an object I update the effect parameters according to the material properties of the given object. To speed that up I use parameter blocks that set all effect parameters at once. Every time a material property changes I capture a new parameter block using ID3DXEffect::BeginParameterBlock / ID3DXEffect::EndParameterBlock. The question is, what happens with the handle to the old parameter block? I have not found a method that releases a handle, so I fear that every time I create a new parameter block the old block leaves a leak. does someone know more about it? ----- dma

Share this post


Link to post
Share on other sites
Advertisement
Having glanced at the SDK it appears that you have nothing to worry about. The only reference count that you need to worry about is that of the LPD3DXEFFECT object.

ace

Share this post


Link to post
Share on other sites
hm ... of course when I release the ID3DXEffect all parameter blocks should also be freed ... but until that happens the number of parameter blocks will increase every time a material property changes ...

----
dma

Share this post


Link to post
Share on other sites
If i were you i would keep an STL Map of parameter block handles. This means that you can switch between them very quickly since the search time is short and also you have contained them so that you can clean thm all up in one go.

ace

Share this post


Link to post
Share on other sites
what I forgot to say is that every material stores it own handle to the paramater block that contains all the properties of the material. When the material properties change a new one is created and the old parameter block is not needed anymore - so I would like to free it (before I finally release the effect itself, which happens at the shut down of the application).
the point is that there does not seem to be a function to free the parameter blocks ...

----
dma

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!