wined3d: Pass a wined3d_adapter_gl structure to wined3d_adapter_gl_init().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ae6ae91d1a
commit
24b0a027ab
|
@ -4554,7 +4554,7 @@ static const struct wined3d_adapter_ops wined3d_adapter_gl_ops =
|
||||||
adapter_gl_check_format,
|
adapter_gl_check_format,
|
||||||
};
|
};
|
||||||
|
|
||||||
static BOOL wined3d_adapter_gl_init(struct wined3d_adapter *adapter,
|
static BOOL wined3d_adapter_gl_init(struct wined3d_adapter_gl *adapter_gl,
|
||||||
unsigned int ordinal, unsigned int wined3d_creation_flags)
|
unsigned int ordinal, unsigned int wined3d_creation_flags)
|
||||||
{
|
{
|
||||||
static const DWORD supported_gl_versions[] =
|
static const DWORD supported_gl_versions[] =
|
||||||
|
@ -4563,19 +4563,16 @@ static BOOL wined3d_adapter_gl_init(struct wined3d_adapter *adapter,
|
||||||
MAKEDWORD_VERSION(3, 2),
|
MAKEDWORD_VERSION(3, 2),
|
||||||
MAKEDWORD_VERSION(1, 0),
|
MAKEDWORD_VERSION(1, 0),
|
||||||
};
|
};
|
||||||
struct wined3d_gl_info *gl_info = &adapter->gl_info;
|
struct wined3d_gl_info *gl_info = &adapter_gl->a.gl_info;
|
||||||
struct wined3d_caps_gl_ctx caps_gl_ctx = {0};
|
struct wined3d_caps_gl_ctx caps_gl_ctx = {0};
|
||||||
struct wined3d_adapter_gl *adapter_gl;
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
TRACE("adapter %p, ordinal %u, wined3d_creation_flags %#x.\n",
|
TRACE("adapter_gl %p, ordinal %u, wined3d_creation_flags %#x.\n",
|
||||||
adapter, ordinal, wined3d_creation_flags);
|
adapter_gl, ordinal, wined3d_creation_flags);
|
||||||
|
|
||||||
if (!wined3d_adapter_init(adapter, ordinal))
|
if (!wined3d_adapter_init(&adapter_gl->a, ordinal))
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
adapter_gl = wined3d_adapter_gl(adapter);
|
|
||||||
|
|
||||||
/* Dynamically load all GL core functions */
|
/* Dynamically load all GL core functions */
|
||||||
#ifdef USE_WIN32_OPENGL
|
#ifdef USE_WIN32_OPENGL
|
||||||
{
|
{
|
||||||
|
@ -4601,9 +4598,9 @@ static BOOL wined3d_adapter_gl_init(struct wined3d_adapter *adapter,
|
||||||
glEnableWINE = gl_info->gl_ops.gl.p_glEnable;
|
glEnableWINE = gl_info->gl_ops.gl.p_glEnable;
|
||||||
glDisableWINE = gl_info->gl_ops.gl.p_glDisable;
|
glDisableWINE = gl_info->gl_ops.gl.p_glDisable;
|
||||||
|
|
||||||
if (!wined3d_caps_gl_ctx_create(adapter, &caps_gl_ctx))
|
if (!wined3d_caps_gl_ctx_create(&adapter_gl->a, &caps_gl_ctx))
|
||||||
{
|
{
|
||||||
ERR("Failed to get a GL context for adapter %p.\n", adapter);
|
ERR("Failed to get a GL context for adapter %p.\n", adapter_gl);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4630,9 +4627,9 @@ static BOOL wined3d_adapter_gl_init(struct wined3d_adapter *adapter,
|
||||||
supported_gl_versions[i] >> 16, supported_gl_versions[i] & 0xffff);
|
supported_gl_versions[i] >> 16, supported_gl_versions[i] & 0xffff);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wined3d_adapter_init_gl_caps(adapter, &caps_gl_ctx, wined3d_creation_flags))
|
if (!wined3d_adapter_init_gl_caps(&adapter_gl->a, &caps_gl_ctx, wined3d_creation_flags))
|
||||||
{
|
{
|
||||||
ERR("Failed to initialize GL caps for adapter %p.\n", adapter);
|
ERR("Failed to initialize GL caps for adapter %p.\n", adapter_gl);
|
||||||
wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);
|
wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
@ -4652,7 +4649,7 @@ static BOOL wined3d_adapter_gl_init(struct wined3d_adapter *adapter,
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!wined3d_adapter_gl_init_format_info(adapter, &caps_gl_ctx))
|
if (!wined3d_adapter_gl_init_format_info(&adapter_gl->a, &caps_gl_ctx))
|
||||||
{
|
{
|
||||||
ERR("Failed to initialize GL format info.\n");
|
ERR("Failed to initialize GL format info.\n");
|
||||||
wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);
|
wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);
|
||||||
|
@ -4662,8 +4659,8 @@ static BOOL wined3d_adapter_gl_init(struct wined3d_adapter *adapter,
|
||||||
|
|
||||||
wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);
|
wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);
|
||||||
|
|
||||||
wined3d_adapter_init_ffp_attrib_ops(adapter);
|
wined3d_adapter_init_ffp_attrib_ops(&adapter_gl->a);
|
||||||
adapter->adapter_ops = &wined3d_adapter_gl_ops;
|
adapter_gl->a.adapter_ops = &wined3d_adapter_gl_ops;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
@ -4675,7 +4672,7 @@ struct wined3d_adapter *wined3d_adapter_gl_create(unsigned int ordinal, unsigned
|
||||||
if (!(adapter = heap_alloc_zero(sizeof(*adapter))))
|
if (!(adapter = heap_alloc_zero(sizeof(*adapter))))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (!wined3d_adapter_gl_init(&adapter->a, ordinal, wined3d_creation_flags))
|
if (!wined3d_adapter_gl_init(adapter, ordinal, wined3d_creation_flags))
|
||||||
{
|
{
|
||||||
heap_free(adapter);
|
heap_free(adapter);
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
Loading…
Reference in New Issue