On 5 October 2016 at 11:17, Józef Kucia jkucia@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.
On Thu, Oct 6, 2016 at 11:28 AM, Henri Verbeet hverbeet@gmail.com wrote:
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.
FWIW, a copy of the wined3d creation flags is stored in d3d_info, so "context->d3d_info.wined3d_creation_flags" is the proper way to get them.
On 6 October 2016 at 11:45, Józef Kucia joseph.kucia@gmail.com wrote:
FWIW, a copy of the wined3d creation flags is stored in d3d_info, so "context->d3d_info.wined3d_creation_flags" is the proper way to get them.
Right, d3d_info is "new".
On Thu, Oct 6, 2016 at 11:46 AM, Henri Verbeet hverbeet@gmail.com wrote:
On 6 October 2016 at 11:45, Józef Kucia joseph.kucia@gmail.com wrote:
FWIW, a copy of the wined3d creation flags is stored in d3d_info, so "context->d3d_info.wined3d_creation_flags" is the proper way to get them.
Right, d3d_info is "new".
Yeah, wined3d_creation_flags is even newer. It was introduced together with WINED3D_SRGB_READ_WRITE_CONTROL.