Commit b0b27730 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Report system shared memory for adapters.

parent f17544a7
...@@ -492,11 +492,12 @@ const struct wined3d_gpu_description *wined3d_get_gpu_description(enum wined3d_p ...@@ -492,11 +492,12 @@ const struct wined3d_gpu_description *wined3d_get_gpu_description(enum wined3d_p
void wined3d_driver_info_init(struct wined3d_driver_info *driver_info, void wined3d_driver_info_init(struct wined3d_driver_info *driver_info,
const struct wined3d_gpu_description *gpu_desc, UINT64 vram_bytes) const struct wined3d_gpu_description *gpu_desc, UINT64 vram_bytes)
{ {
const struct driver_version_information *version_info;
enum wined3d_driver_model driver_model;
enum wined3d_display_driver driver;
MEMORYSTATUSEX memory_status;
OSVERSIONINFOW os_version; OSVERSIONINFOW os_version;
WORD driver_os_version; WORD driver_os_version;
enum wined3d_display_driver driver;
enum wined3d_driver_model driver_model;
const struct driver_version_information *version_info;
memset(&os_version, 0, sizeof(os_version)); memset(&os_version, 0, sizeof(os_version));
os_version.dwOSVersionInfoSize = sizeof(os_version); os_version.dwOSVersionInfoSize = sizeof(os_version);
...@@ -585,6 +586,13 @@ void wined3d_driver_info_init(struct wined3d_driver_info *driver_info, ...@@ -585,6 +586,13 @@ void wined3d_driver_info_init(struct wined3d_driver_info *driver_info,
driver_info->vram_bytes = LONG_MAX; driver_info->vram_bytes = LONG_MAX;
} }
driver_info->sysmem_bytes = 64 * 1024 * 1024;
memory_status.dwLength = sizeof(memory_status);
if (GlobalMemoryStatusEx(&memory_status))
driver_info->sysmem_bytes = max(memory_status.ullTotalPhys / 2, driver_info->sysmem_bytes);
else
ERR("Failed to get global memory status.\n");
/* Try to obtain driver version information for the current Windows version. This fails in /* Try to obtain driver version information for the current Windows version. This fails in
* some cases: * some cases:
* - the gpu is not available on the currently selected OS version: * - the gpu is not available on the currently selected OS version:
...@@ -1200,6 +1208,7 @@ HRESULT CDECL wined3d_get_adapter_identifier(const struct wined3d *wined3d, ...@@ -1200,6 +1208,7 @@ HRESULT CDECL wined3d_get_adapter_identifier(const struct wined3d *wined3d,
identifier->whql_level = (flags & WINED3DENUM_NO_WHQL_LEVEL) ? 0 : 1; identifier->whql_level = (flags & WINED3DENUM_NO_WHQL_LEVEL) ? 0 : 1;
memcpy(&identifier->adapter_luid, &adapter->luid, sizeof(identifier->adapter_luid)); memcpy(&identifier->adapter_luid, &adapter->luid, sizeof(identifier->adapter_luid));
identifier->video_memory = min(~(SIZE_T)0, adapter->driver_info.vram_bytes); identifier->video_memory = min(~(SIZE_T)0, adapter->driver_info.vram_bytes);
identifier->shared_system_memory = min(~(SIZE_T)0, adapter->driver_info.sysmem_bytes);
return WINED3D_OK; return WINED3D_OK;
} }
......
...@@ -2648,6 +2648,7 @@ struct wined3d_driver_info ...@@ -2648,6 +2648,7 @@ struct wined3d_driver_info
const char *name; const char *name;
const char *description; const char *description;
UINT64 vram_bytes; UINT64 vram_bytes;
UINT64 sysmem_bytes;
DWORD version_high; DWORD version_high;
DWORD version_low; DWORD version_low;
}; };
......
...@@ -1736,6 +1736,7 @@ struct wined3d_adapter_identifier ...@@ -1736,6 +1736,7 @@ struct wined3d_adapter_identifier
DWORD whql_level; DWORD whql_level;
LUID adapter_luid; LUID adapter_luid;
SIZE_T video_memory; SIZE_T video_memory;
SIZE_T shared_system_memory;
}; };
struct wined3d_swapchain_desc struct wined3d_swapchain_desc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment