wined3d: Pass an IWineD3DDeviceImpl pointer to shader_free_private().

This commit is contained in:
Henri Verbeet 2010-11-30 18:39:40 +01:00 committed by Alexandre Julliard
parent 4a69874938
commit f45aeb4abe
5 changed files with 18 additions and 18 deletions

View File

@ -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) {

View File

@ -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;
}

View File

@ -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) {

View File

@ -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)

View File

@ -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);