wined3d: Pass an IWineD3DDeviceImpl pointer to free_private().

This commit is contained in:
Henri Verbeet 2010-12-01 20:50:47 +01:00 committed by Alexandre Julliard
parent 6b9118e462
commit a4477fea4a
6 changed files with 19 additions and 18 deletions

View File

@ -5501,15 +5501,16 @@ static void arbfp_free_ffpshader(struct wine_rb_entry *entry, void *context)
} }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static void arbfp_free(IWineD3DDevice *iface) { static void arbfp_free(IWineD3DDeviceImpl *device)
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; {
struct shader_arb_priv *priv = This->fragment_priv; struct shader_arb_priv *priv = device->fragment_priv;
wine_rb_destroy(&priv->fragment_shaders, arbfp_free_ffpshader, &This->adapter->gl_info); wine_rb_destroy(&priv->fragment_shaders, arbfp_free_ffpshader, &device->adapter->gl_info);
priv->use_arbfp_fixed_func = FALSE; priv->use_arbfp_fixed_func = FALSE;
if(This->shader_backend != &arb_program_shader_backend) { if (device->shader_backend != &arb_program_shader_backend)
HeapFree(GetProcessHeap(), 0, This->fragment_priv); {
HeapFree(GetProcessHeap(), 0, device->fragment_priv);
} }
} }

View File

@ -1149,14 +1149,14 @@ static void atifs_free_ffpshader(struct wine_rb_entry *entry, void *context)
} }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static void atifs_free(IWineD3DDevice *iface) { static void atifs_free(IWineD3DDeviceImpl *device)
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface; {
struct atifs_private_data *priv = This->fragment_priv; struct atifs_private_data *priv = device->fragment_priv;
wine_rb_destroy(&priv->fragment_shaders, atifs_free_ffpshader, This); wine_rb_destroy(&priv->fragment_shaders, atifs_free_ffpshader, device);
HeapFree(GetProcessHeap(), 0, priv); HeapFree(GetProcessHeap(), 0, priv);
This->fragment_priv = NULL; device->fragment_priv = NULL;
} }
static BOOL atifs_color_fixup_supported(struct color_fixup_desc fixup) static BOOL atifs_color_fixup_supported(struct color_fixup_desc fixup)

View File

@ -2053,7 +2053,7 @@ err_out:
This->blitter->free_private(iface); This->blitter->free_private(iface);
} }
if (This->fragment_priv) { if (This->fragment_priv) {
This->frag_pipe->free_private(iface); This->frag_pipe->free_private(This);
} }
if (This->shader_priv) { if (This->shader_priv) {
This->shader_backend->shader_free_private(This); This->shader_backend->shader_free_private(This);
@ -2186,7 +2186,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface,
/* Destroy the shader backend. Note that this has to happen after all shaders are destroyed. */ /* Destroy the shader backend. Note that this has to happen after all shaders are destroyed. */
This->blitter->free_private(iface); This->blitter->free_private(iface);
This->frag_pipe->free_private(iface); This->frag_pipe->free_private(This);
This->shader_backend->shader_free_private(This); This->shader_backend->shader_free_private(This);
/* Release the buffers (with sanity checks)*/ /* Release the buffers (with sanity checks)*/
@ -6200,7 +6200,7 @@ static void delete_opengl_contexts(IWineD3DDevice *iface, IWineD3DSwapChainImpl
LEAVE_GL(); LEAVE_GL();
This->blitter->free_private(iface); This->blitter->free_private(iface);
This->frag_pipe->free_private(iface); This->frag_pipe->free_private(This);
This->shader_backend->shader_free_private(This); This->shader_backend->shader_free_private(This);
destroy_dummy_textures(This, gl_info); destroy_dummy_textures(This, gl_info);
@ -6263,7 +6263,7 @@ static HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwap
if (FAILED(hr)) if (FAILED(hr))
{ {
ERR("Failed to allocate blitter private data, hr %#x.\n", hr); ERR("Failed to allocate blitter private data, hr %#x.\n", hr);
This->frag_pipe->free_private(iface); This->frag_pipe->free_private(This);
This->shader_backend->shader_free_private(This); This->shader_backend->shader_free_private(This);
goto err; goto err;
} }

View File

@ -695,7 +695,7 @@ static void nvrc_fragment_get_caps(const struct wined3d_gl_info *gl_info, struct
static HRESULT nvrc_fragment_alloc(IWineD3DDeviceImpl *device) { return WINED3D_OK; } static HRESULT nvrc_fragment_alloc(IWineD3DDeviceImpl *device) { return WINED3D_OK; }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static void nvrc_fragment_free(IWineD3DDevice *iface) {} static void nvrc_fragment_free(IWineD3DDeviceImpl *device) {}
/* Two fixed function pipeline implementations using GL_NV_register_combiners and /* Two fixed function pipeline implementations using GL_NV_register_combiners and
* GL_NV_texture_shader. The nvts_fragment_pipeline assumes that both extensions * GL_NV_texture_shader. The nvts_fragment_pipeline assumes that both extensions

View File

@ -5697,7 +5697,7 @@ static void ffp_fragment_get_caps(const struct wined3d_gl_info *gl_info, struct
} }
static HRESULT ffp_fragment_alloc(IWineD3DDeviceImpl *device) { return WINED3D_OK; } static HRESULT ffp_fragment_alloc(IWineD3DDeviceImpl *device) { return WINED3D_OK; }
static void ffp_fragment_free(IWineD3DDevice *iface) {} static void ffp_fragment_free(IWineD3DDeviceImpl *device) {}
static BOOL ffp_color_fixup_supported(struct color_fixup_desc fixup) static BOOL ffp_color_fixup_supported(struct color_fixup_desc fixup)
{ {
if (TRACE_ON(d3d)) if (TRACE_ON(d3d))

View File

@ -1146,7 +1146,7 @@ struct fragment_pipeline
void (*enable_extension)(BOOL enable); void (*enable_extension)(BOOL enable);
void (*get_caps)(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps); void (*get_caps)(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps);
HRESULT (*alloc_private)(IWineD3DDeviceImpl *device); HRESULT (*alloc_private)(IWineD3DDeviceImpl *device);
void (*free_private)(IWineD3DDevice *iface); void (*free_private)(IWineD3DDeviceImpl *device);
BOOL (*color_fixup_supported)(struct color_fixup_desc fixup); BOOL (*color_fixup_supported)(struct color_fixup_desc fixup);
const struct StateEntryTemplate *states; const struct StateEntryTemplate *states;
BOOL ffp_proj_control; BOOL ffp_proj_control;