Commit 8fa5f1d8 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Also default to OpenGL core contexts on NVIDIA GPUs.

parent 502bcfe2
......@@ -4178,22 +4178,6 @@ static void wined3d_adapter_init_fb_cfgs(struct wined3d_adapter *adapter, HDC dc
}
}
static DWORD get_max_gl_version(const struct wined3d_gl_info *gl_info, DWORD flags)
{
const char *gl_vendor, *gl_renderer;
if (wined3d_settings.explicit_gl_version)
return wined3d_settings.max_gl_version;
gl_vendor = (const char *)gl_info->gl_ops.gl.p_glGetString(GL_VENDOR);
gl_renderer = (const char *)gl_info->gl_ops.gl.p_glGetString(GL_RENDERER);
if (!gl_vendor || !gl_renderer
|| wined3d_guess_card_vendor(gl_vendor, gl_renderer) == HW_VENDOR_NVIDIA)
return MAKEDWORD_VERSION(1, 0);
return wined3d_settings.max_gl_version;
}
static const struct wined3d_adapter_ops wined3d_adapter_gl_ops =
{
wined3d_adapter_gl_create_context,
......@@ -4209,7 +4193,6 @@ BOOL wined3d_adapter_gl_init(struct wined3d_adapter *adapter, DWORD wined3d_crea
};
struct wined3d_gl_info *gl_info = &adapter->gl_info;
struct wined3d_caps_gl_ctx caps_gl_ctx = {0};
DWORD max_gl_version;
unsigned int i;
TRACE("adapter %p, wined3d_creation_flags %#x.\n", adapter, wined3d_creation_flags);
......@@ -4245,16 +4228,15 @@ BOOL wined3d_adapter_gl_init(struct wined3d_adapter *adapter, DWORD wined3d_crea
return FALSE;
}
max_gl_version = get_max_gl_version(gl_info, wined3d_creation_flags);
for (i = 0; i < ARRAY_SIZE(supported_gl_versions); ++i)
{
if (supported_gl_versions[i] <= max_gl_version)
if (supported_gl_versions[i] <= wined3d_settings.max_gl_version)
break;
}
if (i == ARRAY_SIZE(supported_gl_versions))
{
ERR_(winediag)("Requested invalid GL version %u.%u.\n",
max_gl_version >> 16, max_gl_version & 0xffff);
wined3d_settings.max_gl_version >> 16, wined3d_settings.max_gl_version & 0xffff);
i = ARRAY_SIZE(supported_gl_versions) - 1;
}
......
......@@ -73,7 +73,6 @@ static CRITICAL_SECTION wined3d_wndproc_cs = {&wined3d_wndproc_cs_debug, -1, 0,
struct wined3d_settings wined3d_settings =
{
TRUE, /* Multithreaded CS by default. */
FALSE, /* explicit_gl_version */
MAKEDWORD_VERSION(4, 4), /* Default to OpenGL 4.4 */
TRUE, /* Use of GLSL enabled by default */
ORM_FBO, /* Use FBOs to do offscreen rendering */
......@@ -217,7 +216,6 @@ static BOOL wined3d_dll_init(HINSTANCE hInstDLL)
{
ERR_(winediag)("Setting maximum allowed wined3d GL version to %u.%u.\n",
tmpvalue >> 16, tmpvalue & 0xffff);
wined3d_settings.explicit_gl_version = TRUE;
wined3d_settings.max_gl_version = tmpvalue;
}
if ( !get_config_key( hkey, appkey, "UseGLSL", buffer, size) )
......
......@@ -374,7 +374,6 @@ static inline void wined3d_pause(void)
struct wined3d_settings
{
unsigned int cs_multithreaded;
BOOL explicit_gl_version;
DWORD max_gl_version;
BOOL use_glsl;
int offscreen_rendering_mode;
......
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