[PATCH v3 1/7] wined3d: Add extra memory management fields to struct wined3d_adapter.

Henri Verbeet hverbeet at gmail.com
Tue Nov 26 14:01:05 CST 2019


On Mon, 25 Nov 2019 at 17:43, Conor McCarthy <cmccarthy at codeweavers.com> wrote:
>  dlls/wined3d/adapter_gl.c      |  4 +++-
>  dlls/wined3d/adapter_vk.c      |  4 +++-
>  dlls/wined3d/device.c          |  6 +++---
>  dlls/wined3d/directx.c         | 11 +++++++----
>  dlls/wined3d/wined3d_private.h | 10 +++++++++-
>  5 files changed, 25 insertions(+), 10 deletions(-)
>
As it is, most of the things introduced in this patch are unused. With
few exceptions, it would be best to introduce things when they're
needed.

> @@ -1204,10 +1204,10 @@ UINT CDECL wined3d_device_get_available_texture_mem(const struct wined3d_device
>
>      TRACE("Emulating 0x%s bytes. 0x%s used, returning 0x%s left.\n",
>              wine_dbgstr_longlong(driver_info->vram_bytes),
> -            wine_dbgstr_longlong(device->adapter->vram_bytes_used),
> -            wine_dbgstr_longlong(driver_info->vram_bytes - device->adapter->vram_bytes_used));
> +            wine_dbgstr_longlong(device->adapter->memory_usage[0].bytes_used),
> +            wine_dbgstr_longlong(driver_info->vram_bytes - device->adapter->memory_usage[0].bytes_used));
>
> -    return min(UINT_MAX, driver_info->vram_bytes - device->adapter->vram_bytes_used);
> +    return min(UINT_MAX, driver_info->vram_bytes - device->adapter->memory_usage[0].bytes_used);
>  }
It doesn't seem great to reference things by fixed indices like this.
Could we have an enum?



More information about the wine-devel mailing list