Commit a4477fea authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Pass an IWineD3DDeviceImpl pointer to free_private().

parent 6b9118e4
......@@ -5501,15 +5501,16 @@ static void arbfp_free_ffpshader(struct wine_rb_entry *entry, void *context)
}
/* Context activation is done by the caller. */
static void arbfp_free(IWineD3DDevice *iface) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
struct shader_arb_priv *priv = This->fragment_priv;
static void arbfp_free(IWineD3DDeviceImpl *device)
{
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;
if(This->shader_backend != &arb_program_shader_backend) {
HeapFree(GetProcessHeap(), 0, This->fragment_priv);
if (device->shader_backend != &arb_program_shader_backend)
{
HeapFree(GetProcessHeap(), 0, device->fragment_priv);
}
}
......
......@@ -1149,14 +1149,14 @@ static void atifs_free_ffpshader(struct wine_rb_entry *entry, void *context)
}
/* Context activation is done by the caller. */
static void atifs_free(IWineD3DDevice *iface) {
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *) iface;
struct atifs_private_data *priv = This->fragment_priv;
static void atifs_free(IWineD3DDeviceImpl *device)
{
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);
This->fragment_priv = NULL;
device->fragment_priv = NULL;
}
static BOOL atifs_color_fixup_supported(struct color_fixup_desc fixup)
......
......@@ -2053,7 +2053,7 @@ err_out:
This->blitter->free_private(iface);
}
if (This->fragment_priv) {
This->frag_pipe->free_private(iface);
This->frag_pipe->free_private(This);
}
if (This->shader_priv) {
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. */
This->blitter->free_private(iface);
This->frag_pipe->free_private(iface);
This->frag_pipe->free_private(This);
This->shader_backend->shader_free_private(This);
/* Release the buffers (with sanity checks)*/
......@@ -6200,7 +6200,7 @@ static void delete_opengl_contexts(IWineD3DDevice *iface, IWineD3DSwapChainImpl
LEAVE_GL();
This->blitter->free_private(iface);
This->frag_pipe->free_private(iface);
This->frag_pipe->free_private(This);
This->shader_backend->shader_free_private(This);
destroy_dummy_textures(This, gl_info);
......@@ -6263,7 +6263,7 @@ static HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwap
if (FAILED(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);
goto err;
}
......
......@@ -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; }
/* 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
* GL_NV_texture_shader. The nvts_fragment_pipeline assumes that both extensions
......
......@@ -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 void ffp_fragment_free(IWineD3DDevice *iface) {}
static void ffp_fragment_free(IWineD3DDeviceImpl *device) {}
static BOOL ffp_color_fixup_supported(struct color_fixup_desc fixup)
{
if (TRACE_ON(d3d))
......
......@@ -1146,7 +1146,7 @@ struct fragment_pipeline
void (*enable_extension)(BOOL enable);
void (*get_caps)(const struct wined3d_gl_info *gl_info, struct fragment_caps *caps);
HRESULT (*alloc_private)(IWineD3DDeviceImpl *device);
void (*free_private)(IWineD3DDevice *iface);
void (*free_private)(IWineD3DDeviceImpl *device);
BOOL (*color_fixup_supported)(struct color_fixup_desc fixup);
const struct StateEntryTemplate *states;
BOOL ffp_proj_control;
......
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