wined3d: Introduce separate function for OpenGL formats initialisation.

Signed-off-by: Józef Kucia <jkucia@codeweavers.com>
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Józef Kucia 2018-09-20 09:01:59 +02:00 committed by Alexandre Julliard
parent a84dad34ae
commit 6a38579d0f
4 changed files with 20 additions and 9 deletions

View File

@ -4279,7 +4279,7 @@ BOOL wined3d_adapter_gl_init(struct wined3d_adapter *adapter, DWORD wined3d_crea
return FALSE;
}
if (!wined3d_adapter_init_format_info(adapter, &caps_gl_ctx))
if (!wined3d_adapter_gl_init_format_info(adapter, &caps_gl_ctx))
{
ERR("Failed to initialize GL format info.\n");
wined3d_caps_gl_ctx_destroy(&caps_gl_ctx);

View File

@ -2490,7 +2490,7 @@ static BOOL wined3d_adapter_no3d_init(struct wined3d_adapter *adapter)
adapter->vram_bytes_used = 0;
TRACE("Emulating 0x%s bytes of video ram.\n", wine_dbgstr_longlong(adapter->vram_bytes));
if (!wined3d_adapter_init_format_info(adapter, NULL))
if (!wined3d_adapter_init_format_info(adapter))
return FALSE;
adapter->vertex_pipe = &none_vertex_pipe;

View File

@ -3947,17 +3947,27 @@ static void init_format_depth_bias_scale(struct wined3d_adapter *adapter,
}
}
/* Context activation is done by the caller. */
BOOL wined3d_adapter_init_format_info(struct wined3d_adapter *adapter, struct wined3d_caps_gl_ctx *ctx)
BOOL wined3d_adapter_init_format_info(struct wined3d_adapter *adapter)
{
struct wined3d_gl_info *gl_info = &adapter->gl_info;
if (!init_format_base_info(adapter)) return FALSE;
if (!init_format_block_info(adapter)) goto fail;
if (!init_format_decompress_info(adapter)) goto fail;
if (!ctx) /* WINED3D_NO3D */
return TRUE;
return TRUE;
fail:
heap_free(adapter->formats);
adapter->formats = NULL;
return FALSE;
}
/* Context activation is done by the caller. */
BOOL wined3d_adapter_gl_init_format_info(struct wined3d_adapter *adapter, struct wined3d_caps_gl_ctx *ctx)
{
struct wined3d_gl_info *gl_info = &adapter->gl_info;
if (!wined3d_adapter_init_format_info(adapter))
return FALSE;
if (!init_format_texture_info(adapter, gl_info)) goto fail;
if (!init_format_vertex_info(adapter, gl_info)) goto fail;

View File

@ -2690,7 +2690,8 @@ struct wined3d_caps_gl_ctx
GLuint test_program_id;
};
BOOL wined3d_adapter_init_format_info(struct wined3d_adapter *adapter,
BOOL wined3d_adapter_init_format_info(struct wined3d_adapter *adapter) DECLSPEC_HIDDEN;
BOOL wined3d_adapter_gl_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;