[PATCH] Add a registry key for overriding the pci vendor id.
Roderick Colenbrander
thunderbird2k at gmx.net
Sun Nov 23 15:51:03 CST 2008
---
dlls/wined3d/directx.c | 6 ++++++
dlls/wined3d/wined3d_main.c | 18 +++++++++++++++++-
dlls/wined3d/wined3d_private.h | 2 ++
3 files changed, 25 insertions(+), 1 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 6208ef2..46027d8 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -1670,6 +1670,12 @@ static HRESULT WINAPI IWineD3DImpl_GetAdapterIdentifier(IWineD3D *iface, UINT Ad
*(pIdentifier->DeviceId) = wined3d_settings.pci_device_id;
}
+ if(wined3d_settings.pci_vendor_id != PCI_VENDOR_NONE)
+ {
+ TRACE_(d3d_caps)("Overriding pci vendor id with: %x\n", wined3d_settings.pci_vendor_id);
+ *(pIdentifier->VendorId) = wined3d_settings.pci_vendor_id;
+ }
+
if (Flags & WINED3DENUM_NO_WHQL_LEVEL) {
*(pIdentifier->WHQLLevel) = 0;
} else {
diff --git a/dlls/wined3d/wined3d_main.c b/dlls/wined3d/wined3d_main.c
index 4995fa4..ee8f07f 100644
--- a/dlls/wined3d/wined3d_main.c
+++ b/dlls/wined3d/wined3d_main.c
@@ -43,7 +43,8 @@ wined3d_settings_t wined3d_settings =
TRUE, /* Use of GLSL enabled by default */
ORM_BACKBUFFER, /* Use the backbuffer to do offscreen rendering */
RTL_AUTO, /* Automatically determine best locking method */
- PCI_DEVICE_NONE,/* PCI Device ID */
+ PCI_VENDOR_NONE,/* PCI Vendor ID */
+ PCI_DEVICE_NONE,/* PCI Device ID */
0, /* The default of memory is set in FillGLCaps */
NULL, /* No wine logo by default */
FALSE /* Disable multisampling for now due to Nvidia driver bugs which happens for some users */
@@ -263,6 +264,21 @@ BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD fdwReason, LPVOID lpv)
wined3d_settings.pci_device_id = pci_device_id;
}
}
+ if ( !get_config_key_dword( hkey, appkey, "VideoPciVendorID", &tmpvalue) )
+ {
+ int pci_vendor_id = tmpvalue;
+
+ /* A pci device id is 16-bit */
+ if(pci_vendor_id > 0xffff)
+ {
+ ERR("Invalid value for VideoPciVendorID. The value should be smaller or equal to 65535 or 0xffff\n");
+ }
+ else
+ {
+ TRACE("Using PCI Vendor ID %04x\n", pci_vendor_id);
+ wined3d_settings.pci_vendor_id = pci_vendor_id;
+ }
+ }
if ( !get_config_key( hkey, appkey, "VideoMemorySize", buffer, size) )
{
int TmpVideoMemorySize = atoi(buffer);
diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h
index 0e8fe52..e3d35f2 100644
--- a/dlls/wined3d/wined3d_private.h
+++ b/dlls/wined3d/wined3d_private.h
@@ -185,6 +185,7 @@ static inline float float_16_to_32(const unsigned short *in) {
#define RTL_TEXDRAW 3
#define RTL_TEXTEX 4
+#define PCI_VENDOR_NONE 0xffff /* e.g. 0x8086 for Intel and 0x10de for Nvidia */
#define PCI_DEVICE_NONE 0xffff /* e.g. 0x14f for a Geforce6200 */
/* NOTE: When adding fields to this structure, make sure to update the default
@@ -200,6 +201,7 @@ typedef struct wined3d_settings_s {
BOOL glslRequested;
int offscreen_rendering_mode;
int rendertargetlock_mode;
+ unsigned short pci_vendor_id;
unsigned short pci_device_id;
/* Memory tracking and object counting */
unsigned int emulated_textureram;
--
1.5.3.4
--========GMX324161227477410533772--
More information about the wine-patches
mailing list