Sign in to follow this  
dma42

how to release a handle to an effect parameter block?

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
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

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