diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index 67eeef03720..becaa5fbe66 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -4744,8 +4744,8 @@ static const struct wine_rb_functions sig_tree_functions = sig_tree_compare }; -static HRESULT shader_arb_alloc(IWineD3DDevice *iface) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; +static HRESULT shader_arb_alloc(IWineD3DDeviceImpl *device) +{ struct shader_arb_priv *priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*priv)); if(wine_rb_init(&priv->signature_tree, &sig_tree_functions) == -1) { @@ -4753,7 +4753,7 @@ static HRESULT shader_arb_alloc(IWineD3DDevice *iface) { HeapFree(GetProcessHeap(), 0, priv); return E_OUTOFMEMORY; } - This->shader_priv = priv; + device->shader_priv = priv; return WINED3D_OK; } diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index b6f6d2944a0..4efade0c74f 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -1963,7 +1963,7 @@ static HRESULT WINAPI IWineD3DDeviceImpl_Init3D(IWineD3DDevice *iface, if (This->depth_stencil) IWineD3DSurface_AddRef((IWineD3DSurface *)This->depth_stencil); - hr = This->shader_backend->shader_alloc_private(iface); + hr = This->shader_backend->shader_alloc_private(This); if(FAILED(hr)) { TRACE("Shader private data couldn't be allocated\n"); goto err_out; @@ -6244,7 +6244,7 @@ static HRESULT create_primary_opengl_context(IWineD3DDevice *iface, IWineD3DSwap create_dummy_textures(This); context_release(context); - hr = This->shader_backend->shader_alloc_private(iface); + hr = This->shader_backend->shader_alloc_private(This); if (FAILED(hr)) { ERR("Failed to allocate shader private data, hr %#x.\n", hr); diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 9f4940ef20e..2d19a34e2a9 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -4818,9 +4818,9 @@ static const struct wine_rb_functions wined3d_glsl_program_rb_functions = glsl_program_key_compare, }; -static HRESULT shader_glsl_alloc(IWineD3DDevice *iface) { - IWineD3DDeviceImpl *This = (IWineD3DDeviceImpl *)iface; - const struct wined3d_gl_info *gl_info = &This->adapter->gl_info; +static HRESULT shader_glsl_alloc(IWineD3DDeviceImpl *device) +{ + const struct wined3d_gl_info *gl_info = &device->adapter->gl_info; struct shader_glsl_priv *priv = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(struct shader_glsl_priv)); SIZE_T stack_size = wined3d_log2i(max(gl_info->limits.glsl_vs_float_constants, gl_info->limits.glsl_ps_float_constants)) + 1; @@ -4858,7 +4858,7 @@ static HRESULT shader_glsl_alloc(IWineD3DDevice *iface) { priv->next_constant_version = 1; - This->shader_priv = priv; + device->shader_priv = priv; return WINED3D_OK; fail: diff --git a/dlls/wined3d/shader.c b/dlls/wined3d/shader.c index 1caa3b67be4..0af7667368d 100644 --- a/dlls/wined3d/shader.c +++ b/dlls/wined3d/shader.c @@ -1519,7 +1519,7 @@ static void shader_none_load_constants(const struct wined3d_context *context, ch 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(IWineD3DDevice *iface) {return WINED3D_OK;} +static HRESULT shader_none_alloc(IWineD3DDeviceImpl *device) {return WINED3D_OK;} static void shader_none_free(IWineD3DDevice *iface) {} static BOOL shader_none_dirty_const(IWineD3DDevice *iface) {return FALSE;} diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 566e67f48c3..42408322c59 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -759,7 +759,7 @@ typedef struct { void (*shader_load_np2fixup_constants)(void *shader_priv, const struct wined3d_gl_info *gl_info, const struct wined3d_state *state); void (*shader_destroy)(IWineD3DBaseShader *iface); - HRESULT (*shader_alloc_private)(IWineD3DDevice *iface); + HRESULT (*shader_alloc_private)(IWineD3DDeviceImpl *device); void (*shader_free_private)(IWineD3DDevice *iface); BOOL (*shader_dirtifyable_constants)(IWineD3DDevice *iface); void (*shader_get_caps)(const struct wined3d_gl_info *gl_info, struct shader_caps *caps);