From f45aeb4abe00c290d772e4d114c669c438096902 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Tue, 30 Nov 2010 18:39:40 +0100 Subject: [PATCH] wined3d: Pass an IWineD3DDeviceImpl pointer to shader_free_private(). --- dlls/wined3d/arb_program_shader.c | 10 +++++----- dlls/wined3d/device.c | 10 +++++----- dlls/wined3d/glsl_shader.c | 12 ++++++------ dlls/wined3d/shader.c | 2 +- dlls/wined3d/wined3d_private.h | 2 +- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index becaa5fbe66..ac2b0c955eb 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -4770,10 +4770,10 @@ static void release_signature(struct wine_rb_entry *entry, void *context) } /* Context activation is done by the caller. */ -static void shader_arb_free(IWineD3DDevice *iface) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; - struct shader_arb_priv *priv = This->shader_priv; +static void shader_arb_free(IWineD3DDeviceImpl *device) +{ + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + struct shader_arb_priv *priv = device->shader_priv; int i; ENTER_GL(); @@ -4794,7 +4794,7 @@ static void shader_arb_free(IWineD3DDevice *iface) { LEAVE_GL(); wine_rb_destroy(&priv->signature_tree, release_signature, NULL); - HeapFree(GetProcessHeap(), 0, This->shader_priv); + HeapFree(GetProcessHeap(), 0, device->shader_priv); } static BOOL shader_arb_dirty_const(IWineD3DDevice *iface) { diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 4efade0c74f..102b65ce7f7 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -2056,7 +2056,7 @@ err_out: This->frag_pipe->free_private(iface); } if (This->shader_priv) { - This->shader_backend->shader_free_private(iface); + This->shader_backend->shader_free_private(This); } return hr; } @@ -2187,7 +2187,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->shader_backend->shader_free_private(iface); + This->shader_backend->shader_free_private(This); /* Release the buffers (with sanity checks)*/ if (This->onscreen_depth_stencil) @@ -6201,7 +6201,7 @@ static void delete_opengl_contexts(IWineD3DDevice *iface, IWineD3DSwapChainImpl This->blitter->free_private(iface); This->frag_pipe->free_private(iface); - This->shader_backend->shader_free_private(iface); + This->shader_backend->shader_free_private(This); destroy_dummy_textures(This, gl_info); context_release(context); @@ -6255,7 +6255,7 @@ static HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwap if (FAILED(hr)) { ERR("Failed to allocate fragment pipe private data, hr %#x.\n", hr); - This->shader_backend->shader_free_private(iface); + This->shader_backend->shader_free_private(This); goto err; } @@ -6264,7 +6264,7 @@ static HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwap { ERR("Failed to allocate blitter private data, hr %#x.\n", hr); This->frag_pipe->free_private(iface); - This->shader_backend->shader_free_private(iface); + This->shader_backend->shader_free_private(This); goto err; } diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 2d19a34e2a9..58bb1b08010 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -4871,10 +4871,10 @@ fail: } /* Context activation is done by the caller. */ -static void shader_glsl_free(IWineD3DDevice *iface) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; - struct shader_glsl_priv *priv = This->shader_priv; +static void shader_glsl_free(IWineD3DDeviceImpl *device) +{ + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; + struct shader_glsl_priv *priv = device->shader_priv; int i; ENTER_GL(); @@ -4897,8 +4897,8 @@ static void shader_glsl_free(IWineD3DDevice *iface) { HeapFree(GetProcessHeap(), 0, priv->stack); shader_buffer_free(&priv->shader_buffer); - HeapFree(GetProcessHeap(), 0, This->shader_priv); - This->shader_priv = NULL; + HeapFree(GetProcessHeap(), 0, device->shader_priv); + device->shader_priv = NULL; } static BOOL shader_glsl_dirty_const(IWineD3DDevice *iface) { diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 0af7667368d..1804f583999 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -1520,7 +1520,7 @@ static void shader_none_load_np2fixup_constants(void *shader_priv, const struct wined3d_gl_info *gl_info, const struct wined3d_state *state) {} static void shader_none_destroy(IWineD3DBaseShader *iface) {} static HRESULT shader_none_alloc(IWineD3DDeviceImpl *device) {return WINED3D_OK;} -static void shader_none_free(IWineD3DDevice *iface) {} +static void shader_none_free(IWineD3DDeviceImpl *device) {} static BOOL shader_none_dirty_const(IWineD3DDevice *iface) {return FALSE;} static void shader_none_get_caps(const struct wined3d_gl_info *gl_info, struct shader_caps *caps) diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 42408322c59..8da99dbd3d6 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -760,7 +760,7 @@ typedef struct { const struct wined3d_state *state); void (*shader_destroy)(IWineD3DBaseShader *iface); HRESULT (*shader_alloc_private)(IWineD3DDeviceImpl *device); - void (*shader_free_private)(IWineD3DDevice *iface); + void (*shader_free_private)(IWineD3DDeviceImpl *device); BOOL (*shader_dirtifyable_constants)(IWineD3DDevice *iface); void (*shader_get_caps)(const struct wined3d_gl_info *gl_info, struct shader_caps *caps); BOOL (*shader_color_fixup_supported)(struct color_fixup_desc fixup);