Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/wined3d/adapter_gl.c | 15 ++++----------- dlls/wined3d/directx.c | 25 +++++++++++++++++++------ dlls/wined3d/wined3d_private.h | 1 + 3 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/dlls/wined3d/adapter_gl.c b/dlls/wined3d/adapter_gl.c index 6f39a3e0c66..f3862cd32c3 100644 --- a/dlls/wined3d/adapter_gl.c +++ b/dlls/wined3d/adapter_gl.c @@ -1015,13 +1015,6 @@ static const struct wined3d_gpu_description *query_gpu_description(const struct TRACE("Overriding device PCI ID with 0x%04x.\n", device); }
- if (wined3d_settings.emulated_textureram) - { - *vram_bytes = wined3d_settings.emulated_textureram; - TRACE("Overriding amount of video memory with 0x%s bytes.\n", - wine_dbgstr_longlong(*vram_bytes)); - } - if (!(gpu_description = wined3d_get_gpu_description(vendor, device)) && (wined3d_settings.pci_vendor_id != PCI_VENDOR_NONE || wined3d_settings.pci_device_id != PCI_DEVICE_NONE) && !once++) @@ -3816,6 +3809,10 @@ static BOOL wined3d_adapter_init_gl_caps(struct wined3d_adapter *adapter, TRACE("Reporting (fake) driver version 0x%08x-0x%08x.\n", driver_info->version_high, driver_info->version_low);
+ adapter->vram_bytes = driver_info->vram_bytes; + adapter->vram_bytes_used = 0; + TRACE("Emulating 0x%s bytes of video ram.\n", wine_dbgstr_longlong(adapter->vram_bytes)); + gl_ext_emul_mask = adapter->vertex_pipe->vp_get_emul_mask(gl_info) | adapter->fragment_pipe->get_emul_mask(gl_info); if (gl_ext_emul_mask & GL_EXT_EMUL_ARB_MULTITEXTURE) @@ -4286,10 +4283,6 @@ BOOL wined3d_adapter_opengl_init(struct wined3d_adapter *adapter, DWORD wined3d_ return FALSE; }
- adapter->vram_bytes = adapter->driver_info.vram_bytes; - adapter->vram_bytes_used = 0; - TRACE("Emulating 0x%s bytes of video ram.\n", wine_dbgstr_longlong(adapter->vram_bytes)); - wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);
wined3d_adapter_init_ffp_attrib_ops(adapter); diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c index 36005064284..919c3e76084 100644 --- a/dlls/wined3d/directx.c +++ b/dlls/wined3d/directx.c @@ -189,6 +189,9 @@ static const struct driver_version_information driver_version_table[] =
/* VMware */ {DRIVER_VMWARE, DRIVER_MODEL_NT5X, "vm3dum.dll", 14, 1, 1134}, + + /* Wine */ + {DRIVER_WINE, DRIVER_MODEL_GENERIC, "wined3d.dll", 0, 0, 0}, };
/* The amount of video memory stored in the gpu description table is the minimum amount of video memory @@ -563,6 +566,13 @@ void wined3d_driver_info_init(struct wined3d_driver_info *driver_info, driver_info->vram_bytes = vram_bytes ? vram_bytes : (UINT64)gpu_desc->vidmem * 1024 * 1024; driver = gpu_desc->driver;
+ if (wined3d_settings.emulated_textureram) + { + driver_info->vram_bytes = wined3d_settings.emulated_textureram; + TRACE("Overriding amount of video memory with 0x%s bytes.\n", + wine_dbgstr_longlong(driver_info->vram_bytes)); + } + /** * 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 @@ -2473,14 +2483,17 @@ static const struct wined3d_adapter_ops wined3d_adapter_no3d_ops =
static BOOL wined3d_adapter_no3d_init(struct wined3d_adapter *adapter) { + static const struct wined3d_gpu_description gpu_description = + { + HW_VENDOR_SOFTWARE, CARD_WINE, "WineD3D DirectDraw Emulation", DRIVER_WINE, 128, + }; + TRACE("adapter %p.\n", adapter);
- adapter->driver_info.name = "Display"; - adapter->driver_info.description = "WineD3D DirectDraw Emulation"; - if (wined3d_settings.emulated_textureram) - adapter->vram_bytes = wined3d_settings.emulated_textureram; - else - adapter->vram_bytes = 128 * 1024 * 1024; + wined3d_driver_info_init(&adapter->driver_info, &gpu_description, 0); + adapter->vram_bytes = adapter->driver_info.vram_bytes; + adapter->vram_bytes_used = 0; + TRACE("Emulating 0x%s bytes of video ram.\n", wine_dbgstr_longlong(adapter->vram_bytes));
if (!wined3d_adapter_init_format_info(adapter, NULL)) return FALSE; diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 69eda3ebb64..850d66e1282 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -2607,6 +2607,7 @@ enum wined3d_display_driver DRIVER_NVIDIA_GEFORCE6, DRIVER_NVIDIA_GEFORCE8, DRIVER_VMWARE, + DRIVER_WINE, DRIVER_UNKNOWN, };