wined3d: Limit amount of video memory for older Windows versions.

This should affect only 32-bit applications when the emulated Windows
version is set to "Windows 2003" or older.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2016-03-11 13:28:03 +01:00 committed by Alexandre Julliard
parent 630f5e97b1
commit 565a571546
1 changed files with 12 additions and 0 deletions

View File

@ -1510,6 +1510,18 @@ static void init_driver_info(struct wined3d_driver_info *driver_info,
driver = DRIVER_UNKNOWN;
}
/**
* Diablo 2 crashes when the amount of video memory is greater than 0x7fffffff.
* In order to avoid this application bug we limit the amount of video memory
* to LONG_MAX for older Windows versions.
*/
if (os_version.dwMajorVersion <= 5 && os_version.dwMinorVersion <= 2
&& driver_info->vram_bytes > LONG_MAX)
{
TRACE("Limiting amount of video memory to %#lx bytes for OS version older than Vista.\n", LONG_MAX);
driver_info->vram_bytes = LONG_MAX;
}
if (wined3d_settings.emulated_textureram)
{
TRACE("Overriding amount of video memory with 0x%s bytes.\n",