Refcounting fun

H. Verbeet hverbeet at gmail.com
Mon Feb 13 05:34:21 CST 2006


On 13/02/06, Stefan Dösinger <stefandoesinger at gmx.at> wrote:
> Hi,
> > Well, I agree it's not a great construction. I'm just not sure if
> > using the container in that way makes things much better. It would
> > mean having to retrieve the surface container in each call to
> > IDirect3D9Surface_Release.
> Do you think it might be a performance problem?
I'm not sure, probably not that much, but it depends on whether the
AddRef / Release functions are called a lot. If we use GetContainer,
it would make a call to QueryInterface. If the surface hasn't got a
container it makes a call to GetDevice and returns the wined3d device.
We'd have to account for that as well. Or we could write a function to
just retrieve the pointer. We would of course also have to get the
d3d9 parent of the container.

> > You can't easily store it in d3d9 since
> > when the wined3d surface's container changes the d3d9 container would
> > have to change as well, but you can't call much of anything in d3d9
> > without adding another callback.
> Can containers change? I thought that the container is set at creation time
> and can't change?
I'm not sure if it happens or not (and if it is actually required when
it happens :)), but the function to change it is there. Of course if
we can be sure it never happens that would mean we could just store
the pointer to the container in d3d9 during creation time and set it
to NULL when releasing the container.



More information about the wine-devel mailing list