Commit 2f6dd580 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

wined3d: Get rid of initPixelFormatsNoGL().

parent 6640bc32
......@@ -6394,7 +6394,7 @@ static BOOL wined3d_adapter_init(struct wined3d_adapter *adapter, UINT ordinal,
return TRUE;
}
static void wined3d_adapter_init_nogl(struct wined3d_adapter *adapter, UINT ordinal)
static BOOL wined3d_adapter_init_nogl(struct wined3d_adapter *adapter, UINT ordinal)
{
DISPLAY_DEVICEW display_device;
......@@ -6408,7 +6408,8 @@ static void wined3d_adapter_init_nogl(struct wined3d_adapter *adapter, UINT ordi
else
adapter->vram_bytes = 128 * 1024 * 1024;
initPixelFormatsNoGL(&adapter->gl_info);
if (!wined3d_adapter_init_format_info(adapter, NULL))
return FALSE;
adapter->vertex_pipe = &none_vertex_pipe;
adapter->fragment_pipe = &none_fragment_pipe;
......@@ -6419,6 +6420,8 @@ static void wined3d_adapter_init_nogl(struct wined3d_adapter *adapter, UINT ordi
EnumDisplayDevicesW(NULL, ordinal, &display_device, 0);
TRACE("DeviceName: %s\n", debugstr_w(display_device.DeviceName));
strcpyW(adapter->DeviceName, display_device.DeviceName);
return TRUE;
}
static void STDMETHODCALLTYPE wined3d_null_wined3d_object_destroyed(void *parent) {}
......@@ -6430,19 +6433,18 @@ const struct wined3d_parent_ops wined3d_null_parent_ops =
HRESULT wined3d_init(struct wined3d *wined3d, DWORD flags)
{
BOOL ret;
wined3d->ref = 1;
wined3d->flags = flags;
TRACE("Initializing adapters.\n");
if (flags & WINED3D_NO3D)
{
wined3d_adapter_init_nogl(&wined3d->adapters[0], 0);
wined3d->adapter_count = 1;
return WINED3D_OK;
}
if (!wined3d_adapter_init(&wined3d->adapters[0], 0, flags))
ret = wined3d_adapter_init_nogl(&wined3d->adapters[0], 0);
else
ret = wined3d_adapter_init(&wined3d->adapters[0], 0, flags);
if (!ret)
{
WARN("Failed to initialize adapter.\n");
return E_FAIL;
......
......@@ -3482,28 +3482,17 @@ static BOOL init_typeless_formats(struct wined3d_gl_info *gl_info)
return TRUE;
}
BOOL initPixelFormatsNoGL(struct wined3d_gl_info *gl_info)
{
if (!init_format_base_info(gl_info)) return FALSE;
if (!init_format_block_info(gl_info))
{
HeapFree(GetProcessHeap(), 0, gl_info->formats);
gl_info->formats = NULL;
return FALSE;
}
return TRUE;
}
/* Context activation is done by the caller. */
BOOL wined3d_adapter_init_format_info(struct wined3d_adapter *adapter, struct wined3d_caps_gl_ctx *ctx)
{
struct wined3d_gl_info *gl_info = &adapter->gl_info;
if (!init_format_base_info(gl_info)) return FALSE;
if (!init_format_block_info(gl_info)) goto fail;
if (!ctx) /* WINED3D_NO3D */
return TRUE;
if (!init_format_texture_info(adapter, gl_info)) goto fail;
if (!init_format_vertex_info(gl_info)) goto fail;
......
......@@ -2337,7 +2337,6 @@ BOOL wined3d_adapter_init_format_info(struct wined3d_adapter *adapter,
struct wined3d_caps_gl_ctx *ctx) DECLSPEC_HIDDEN;
UINT64 adapter_adjust_memory(struct wined3d_adapter *adapter, INT64 amount) DECLSPEC_HIDDEN;
BOOL initPixelFormatsNoGL(struct wined3d_gl_info *gl_info) DECLSPEC_HIDDEN;
void install_gl_compat_wrapper(struct wined3d_gl_info *gl_info, enum wined3d_gl_extension ext) DECLSPEC_HIDDEN;
enum projection_types
......
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