Jörg Höhle : wined3d: Delete meaningless UNIX GL driver version parsing.
Alexandre Julliard
julliard at winehq.org
Thu Aug 27 10:31:05 CDT 2009
Module: wine
Branch: master
Commit: b9d955b86d2c03ad877767d97ad77f092d664ceb
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b9d955b86d2c03ad877767d97ad77f092d664ceb
Author: Jörg Höhle <hoehle at users.sourceforge.net>
Date: Sun Aug 23 19:35:36 2009 +0200
wined3d: Delete meaningless UNIX GL driver version parsing.
---
dlls/wined3d/directx.c | 109 ++---------------------------------------------
1 files changed, 5 insertions(+), 104 deletions(-)
diff --git a/dlls/wined3d/directx.c b/dlls/wined3d/directx.c
index 64f04fc..8d1995d 100644
--- a/dlls/wined3d/directx.c
+++ b/dlls/wined3d/directx.c
@@ -927,7 +927,9 @@ static void fixup_extensions(struct wined3d_gl_info *gl_info, const char *gl_ren
/* Find out if PBOs work as they are supposed to. */
test_pbo_functionality(gl_info);
- /* Fixup the driver version */
+ /* Fixup the driver version we'll report to the app. */
+ gl_info->driver_version = MAKEDWORD_VERSION(8, 6); /* Nvidia RIVA TNT, arbitrary */
+ gl_info->driver_version_hipart = MAKEDWORD_VERSION(7, 1);
for (i = 0; i < (sizeof(driver_version_table) / sizeof(driver_version_table[0])); ++i)
{
if (gl_info->gl_vendor == driver_version_table[i].vendor
@@ -944,6 +946,8 @@ static void fixup_extensions(struct wined3d_gl_info *gl_info, const char *gl_ren
break;
}
}
+ TRACE_(d3d_caps)("Reporting (fake) driver version 0x%08X-0x%08X.\n",
+ gl_info->driver_version_hipart, gl_info->driver_version);
}
static DWORD wined3d_parse_gl_version(const char *gl_version)
@@ -964,105 +968,6 @@ static DWORD wined3d_parse_gl_version(const char *gl_version)
return MAKEDWORD_VERSION(major, minor);
}
-static DWORD wined3d_guess_driver_version(const char *gl_version, GL_Vendors vendor)
-{
- int major, minor;
- const char *ptr;
- DWORD ret;
-
- /* Now parse the driver specific string which we'll report to the app. */
- switch (vendor)
- {
- case VENDOR_NVIDIA:
- ptr = strstr(gl_version, "NVIDIA");
- if (!ptr) return 0;
-
- ptr = strstr(ptr, " ");
- if (!ptr) return 0;
-
- while (isspace(*ptr)) ++ptr;
- if (!*ptr) return 0;
-
- major = atoi(ptr);
- while (isdigit(*ptr)) ++ptr;
-
- if (*ptr++ != '.') return 0;
-
- minor = atoi(ptr);
- minor = major * 100 + minor;
- major = 10;
- break;
-
- case VENDOR_ATI:
- major = minor = 0;
-
- ptr = strchr(gl_version, '-');
- if (!ptr) return 0;
-
- ++ptr;
-
- /* Check if version number is of the form x.y.z. */
- if (strlen(ptr) < 5
- || !isdigit(ptr[0]) || ptr[1] != '.'
- || !isdigit(ptr[2]) || ptr[3] != '.'
- || !isdigit(ptr[4]))
- {
- return 0;
- }
-
- major = ptr[0] - '0';
- minor = ((ptr[2] - '0') << 8) | (ptr[4] - '0');
- break;
-
- case VENDOR_INTEL:
- /* Apple and Mesa version strings look differently, but both provide intel drivers. */
- if (strstr(gl_version, "APPLE"))
- {
- /* [0-9]+.[0-9]+ APPLE-[0-9]+.[0.9]+.[0.9]+
- * We only need the first part, and use the APPLE as identification
- * "1.2 APPLE-1.4.56". */
- ptr = gl_version;
-
- major = atoi(ptr);
- while (isdigit(*ptr)) ++ptr;
-
- if (*ptr++ != '.') return 0;
-
- minor = atoi(ptr);
- break;
- }
- /* Fallthrough */
-
- case VENDOR_MESA:
- ptr = strstr(gl_version, "Mesa");
- if (!ptr) return 0;
-
- ptr = strstr(ptr, " ");
- if (!ptr) return 0;
-
- while (isspace(*ptr)) ++ptr;
- if (!*ptr) return 0;
-
- major = atoi(ptr);
- while (isdigit(*ptr)) ++ptr;
-
- if (*ptr++ != '.') return 0;
-
- minor = atoi(ptr);
- break;
-
- default:
- FIXME("Unhandled vendor %#x.\n", vendor);
- return 0;
- }
-
- ret = MAKEDWORD_VERSION(major, minor);
- TRACE_(d3d_caps)("Found driver version %s -> %d.%d -> 0x%08x.\n",
- debugstr_a(gl_version), major, minor, ret);
-
- return ret;
-}
-
static GL_Vendors wined3d_guess_vendor(const char *gl_vendor, const char *gl_renderer)
{
if (strstr(gl_vendor, "NVIDIA"))
@@ -1605,10 +1510,6 @@ static BOOL IWineD3DImpl_FillGLCaps(struct wined3d_gl_info *gl_info)
return FALSE;
}
gl_version = wined3d_parse_gl_version(gl_string);
- gl_info->driver_version = wined3d_guess_driver_version(gl_string, gl_info->gl_vendor);
- if (!gl_info->driver_version) FIXME_(d3d_caps)("Unrecognized GL_VERSION %s.\n", debugstr_a(gl_string));
- /* Current Windows drivers have versions like 6.14.... (some older have an earlier version). */
- gl_info->driver_version_hipart = MAKEDWORD_VERSION(6, 14);
/*
* Initialize openGL extension related variables
More information about the wine-cvs
mailing list