[PATCH 5/7] wined3d: Avoid destroying active contexts.

Henri Verbeet hverbeet at gmail.com
Thu Oct 6 04:28:17 CDT 2016


On 5 October 2016 at 11:17, Józef Kucia <jkucia at codeweavers.com> wrote:
> Ideally, a pointer to a swapchain would be completely removed from
> struct wined3d_context.
Yeah. One of the things that made me hesitate a bit about the first
patch in this series is that it was originally an explicit design
decision to avoid storing a pointer to the device in the context. At
the time we needed the swapchain pointer, I think for the window or DC
handle or something. Over time the reasons for having the swapchain
pointer mostly went away, and it ended up as more of a way to get
around not being able to access the device. Perhaps that's worse than
what we were trying to avoid.

Still, ideally the context wouldn't have a device pointer either. I
think the legitimate accesses to the device are mostly either
accessing shared resources like textures and samplers, or using the
device to get at the wined3d creation flags. We can probably store the
shared resources in some structure inside the device, and then store a
pointer to that in the context instead, and probably just copy the
flags.



More information about the wine-devel mailing list