[PATCH 04/10] wined3d: Add functions to support device local and non-local memory info management.
Henri Verbeet
hverbeet at gmail.com
Mon Nov 11 11:25:29 CST 2019
On Thu, 7 Nov 2019 at 18:25, Conor McCarthy <cmccarthy at codeweavers.com> wrote:
> +HRESULT CDECL wined3d_update_adapter_memory_info(const struct wined3d *wined3d, unsigned int adapter_idx,
> + unsigned int non_local, UINT64 bytes_total, UINT64 bytes_used)
> +{
> + struct wined3d_adapter *adapter;
> + DWORD i;
> +
> + wined3d_mutex_lock();
> +
> + if (adapter_idx >= wined3d->adapter_count || non_local >= ARRAY_SIZE(adapter->memory_usage))
> + goto fail;
> +
> + adapter = wined3d->adapters[adapter_idx];
> + adapter->memory_usage[non_local].bytes_used = bytes_used;
This would override any accounting done by adapter_adjust_memory(),
and potentially unbalance allocations and frees done through there.
More information about the wine-devel
mailing list