Re: [PATCH 1/5] wined3d: Decouple private data from the resource structure.
On 24 February 2014 15:37, Stefan Dösinger <stefan(a)codeweavers.com> wrote:
@@ -1976,6 +1976,19 @@ static inline void context_invalidate_active_texture(struct wined3d_context *con context_invalidate_state(context, STATE_SAMPLER(sampler)); }
+struct wined3d_privstore +{ + struct list content; +}; + +struct wined3d_privstore *wined3d_privstore_create(void) DECLSPEC_HIDDEN; +void wined3d_privstore_destroy(struct wined3d_privstore *store) DECLSPEC_HIDDEN; +HRESULT wined3d_privstore_free_private_data(struct wined3d_privstore *store, const GUID *guid); +HRESULT wined3d_privstore_get_private_data(const struct wined3d_privstore *store, + const GUID *guid, void *data, DWORD *data_size, BOOL addref) DECLSPEC_HIDDEN; +HRESULT wined3d_privstore_set_private_data(struct wined3d_privstore *store, + const GUID *guid, const void *data, DWORD data_size, DWORD flags) DECLSPEC_HIDDEN; + #define WINED3D_RESOURCE_ACCESS_GPU 0x1 #define WINED3D_RESOURCE_ACCESS_CPU 0x2
I'm not entirely convinced this is how we want this to work. Calling HeapAlloc() for a struct list seems less than ideal, and I'd like the WINED3DSPD_IUNKNOWN handling to be done by the callers.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Am 2014-02-25 13:27, schrieb Henri Verbeet:
Calling HeapAlloc() for a struct list seems less than ideal, That is easy to fix. It will move the actual structure definition into the public header though.
and I'd like the WINED3DSPD_IUNKNOWN handling to be done by the callers. For get_private_data that's fairly easy. I can just return the stored flags and the caller decides if it wants to addref anything.
For set_private_data it's tricky. The caller would have to know the old contents, same for free_private_data and the destruction of the store. With that amount of logic in the caller we might as well re-implement the entire thing in each calling library. But the getter behavior is version specific part, so I think just moving that out makes sense on its own. wine-devel(a)winehq.org -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.22 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJTDLZnAAoJEN0/YqbEcdMwyNcP/3Yalc3Rvg25xk6LkI1jAVwT M+n1sdBNyYt0mFMOM2bbg4CWr6TwFtO4Wq4xOYJIV1L/JpjEipK5N3Acv7mCFCGL X+Ksth9juulUULc187fKbZgOgbB/vZP6LWiO23bmIlI+5RYAODavvjrIzJN4FyTh Fvw8sAKpIv6fiX4Ev5GyqRwmVTeUMU5UZ7Gmc1D269YXTAINeVnlrVoBOOTGCCfm toZwXsLmzgGbJRkI/Zul3sx5KJBdwvAY6ZOK9NSIoDuqdAYfVqyKVqP/AQEaX196 LcgkCkMBqYpk4VpWOD52TluIQ1cLBtBch6VDxW8ULor3VYt0jhtYuvA1K5uU7FI0 BiR/w32tIT1ApPN71Qn/EpRwUfsDvKRZB3hYNO4AmfAo+Ro8eVuMPKJRtXx7Icyy XXbtGhYGauiEP90M3yhy3fxxrxhuzaiMnymZWFt3Zxr+dWNoJT82ILflp/v0uYp0 BXYArO9AM8O2KeFl3eBRey/Xl+pHVBdfd1fHjWBBqpsWcWQ3MZ5fcdY30vwmjBIq plzxMZWWA+2Gl9HVwLmNSSORPjtjqsC/mBP19IPr0WWiCDUQNuwpwCf1LKUZWGTP xwOwYSQd7k+U8IrqkVwotEDGsEPADWpaR81aiudEJqV4J2d8Wt3ck3iwDtjSPPKZ QTnAy4/SvHNmek46m6oM =+wqG -----END PGP SIGNATURE-----
participants (2)
-
Henri Verbeet -
Stefan Dösinger