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

wined3d: Pass an IWineD3DDeviceImpl pointer to shader_free_private().

parent 4a698749
...@@ -4770,10 +4770,10 @@ static void release_signature(struct wine_rb_entry *entry, void *context) ...@@ -4770,10 +4770,10 @@ static void release_signature(struct wine_rb_entry *entry, void *context)
} }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static void shader_arb_free(IWineD3DDevice *iface) { static void shader_arb_free(IWineD3DDeviceImpl *device)
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; {
const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
struct shader_arb_priv *priv = This->shader_priv; struct shader_arb_priv *priv = device->shader_priv;
int i; int i;
ENTER_GL(); ENTER_GL();
...@@ -4794,7 +4794,7 @@ static void shader_arb_free(IWineD3DDevice *iface) { ...@@ -4794,7 +4794,7 @@ static void shader_arb_free(IWineD3DDevice *iface) {
LEAVE_GL(); LEAVE_GL();
wine_rb_destroy(&priv->signature_tree, release_signature, NULL); 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) { static BOOL shader_arb_dirty_const(IWineD3DDevice *iface) {
......
...@@ -2056,7 +2056,7 @@ err_out: ...@@ -2056,7 +2056,7 @@ err_out:
This->frag_pipe->free_private(iface); This->frag_pipe->free_private(iface);
} }
if (This->shader_priv) { if (This->shader_priv) {
This->shader_backend->shader_free_private(iface); This->shader_backend->shader_free_private(This);
} }
return hr; return hr;
} }
...@@ -2187,7 +2187,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Uninit3D(IWineD3DDevice *iface, ...@@ -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. */ /* 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(iface);
This->shader_backend->shader_free_private(iface); This->shader_backend->shader_free_private(This);
/* Release the buffers (with sanity checks)*/ /* Release the buffers (with sanity checks)*/
if (This->onscreen_depth_stencil) if (This->onscreen_depth_stencil)
...@@ -6201,7 +6201,7 @@ static void delete_opengl_contexts(IWineD3DDevice *iface, IWineD3DSwapChainImpl ...@@ -6201,7 +6201,7 @@ static void delete_opengl_contexts(IWineD3DDevice *iface, IWineD3DSwapChainImpl
This->blitter->free_private(iface); This->blitter->free_private(iface);
This->frag_pipe->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); destroy_dummy_textures(This, gl_info);
context_release(context); context_release(context);
...@@ -6255,7 +6255,7 @@ static HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwap ...@@ -6255,7 +6255,7 @@ static HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwap
if (FAILED(hr)) if (FAILED(hr))
{ {
ERR("Failed to allocate fragment pipe private data, hr %#x.\n", 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; goto err;
} }
...@@ -6264,7 +6264,7 @@ static HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwap ...@@ -6264,7 +6264,7 @@ static HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwap
{ {
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(iface);
This->shader_backend->shader_free_private(iface); This->shader_backend->shader_free_private(This);
goto err; goto err;
} }
......
...@@ -4871,10 +4871,10 @@ fail: ...@@ -4871,10 +4871,10 @@ fail:
} }
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static void shader_glsl_free(IWineD3DDevice *iface) { static void shader_glsl_free(IWineD3DDeviceImpl *device)
IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; {
const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; const struct wined3d_gl_info *gl_info = &device->adapter->gl_info;
struct shader_glsl_priv *priv = This->shader_priv; struct shader_glsl_priv *priv = device->shader_priv;
int i; int i;
ENTER_GL(); ENTER_GL();
...@@ -4897,8 +4897,8 @@ static void shader_glsl_free(IWineD3DDevice *iface) { ...@@ -4897,8 +4897,8 @@ static void shader_glsl_free(IWineD3DDevice *iface) {
HeapFree(GetProcessHeap(), 0, priv->stack); HeapFree(GetProcessHeap(), 0, priv->stack);
shader_buffer_free(&priv->shader_buffer); shader_buffer_free(&priv->shader_buffer);
HeapFree(GetProcessHeap(), 0, This->shader_priv); HeapFree(GetProcessHeap(), 0, device->shader_priv);
This->shader_priv = NULL; device->shader_priv = NULL;
} }
static BOOL shader_glsl_dirty_const(IWineD3DDevice *iface) { static BOOL shader_glsl_dirty_const(IWineD3DDevice *iface) {
......
...@@ -1520,7 +1520,7 @@ static void shader_none_load_np2fixup_constants(void *shader_priv, ...@@ -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) {} const struct wined3d_gl_info *gl_info, const struct wined3d_state *state) {}
static void shader_none_destroy(IWineD3DBaseShader *iface) {} static void shader_none_destroy(IWineD3DBaseShader *iface) {}
static HRESULT shader_none_alloc(IWineD3DDeviceImpl *device) {return WINED3D_OK;} 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 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) static void shader_none_get_caps(const struct wined3d_gl_info *gl_info, struct shader_caps *caps)
......
...@@ -760,7 +760,7 @@ typedef struct { ...@@ -760,7 +760,7 @@ typedef struct {
const struct wined3d_state *state); const struct wined3d_state *state);
void (*shader_destroy)(IWineD3DBaseShader *iface); void (*shader_destroy)(IWineD3DBaseShader *iface);
HRESULT (*shader_alloc_private)(IWineD3DDeviceImpl *device); HRESULT (*shader_alloc_private)(IWineD3DDeviceImpl *device);
void (*shader_free_private)(IWineD3DDevice *iface); void (*shader_free_private)(IWineD3DDeviceImpl *device);
BOOL (*shader_dirtifyable_constants)(IWineD3DDevice *iface); BOOL (*shader_dirtifyable_constants)(IWineD3DDevice *iface);
void (*shader_get_caps)(const struct wined3d_gl_info *gl_info, struct shader_caps *caps); 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); BOOL (*shader_color_fixup_supported)(struct color_fixup_desc fixup);
......
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