[PATCH 2/2] wined3d: Re-use old wined3d_private_data structures if the size matches.

Henri Verbeet hverbeet at gmail.com
Fri Mar 14 10:27:19 CDT 2014


On 14 March 2014 14:50, Stefan Dösinger <stefan at codeweavers.com> wrote:
> +    if ((old = wined3d_private_store_get_private_data(store, guid)) && old->size == data_size)
> +    {
> +        IUnknown *release = NULL;
> +        if (old->flags & WINED3DSPD_IUNKNOWN)
> +            release = old->content.object;
> +        memcpy(old->content.data, ptr, data_size);
> +        old->flags = flags;
> +        if (flags & WINED3DSPD_IUNKNOWN)
> +            IUnknown_AddRef(old->content.object);
> +        if (release)
> +            IUnknown_Release(release);
> +        return WINED3D_OK;
> +    }
What is the motivation for this? It certainly doesn't make the code
any prettier.



More information about the wine-devel mailing list