On Tue, 2 Mar 2021 at 05:42, Zebediah Figura z.figura12@gmail.com wrote:
This is a proposed approach at implementing deferred contexts. The idea is to create a wined3d_cs object per ID3D11DeviceContext. Deferred contexts will have their own wined3d_cs_ops structure, and some operations (i.e. maps and queries) will be partially split to wined3d_cs_ops methods.
The point of this patch is to avoid allocating space for unused wined3d_state objects. Presumably other fields could also be moved to the wined3d_cs_state structure as well.
As a principle, it's probably fine that an "immediate" cs would have some additional data that a deferred cs doesn't. I'd suggest to split that the same way we do in other places though. E.g.:
struct wined3d_cs { const struct wined3d_cs_ops *ops; ... };
struct wined3d_cs_immediate { struct wined3d_cs c; ... struct wined3d_state state; ... };
struct wined3d_cs_mt { struct wined3d_cs_immediate c; ... HANDLE thread; ... };