Commit 55f2d655 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d9: Use wined3d_texture_get_sub_resource_parent() in d3d9_device_create_surface().

parent 60a7cb66
...@@ -1108,7 +1108,6 @@ static HRESULT d3d9_device_create_surface(struct d3d9_device *device, UINT width ...@@ -1108,7 +1108,6 @@ static HRESULT d3d9_device_create_surface(struct d3d9_device *device, UINT width
D3DFORMAT format, DWORD flags, IDirect3DSurface9 **surface, UINT usage, D3DPOOL pool, D3DFORMAT format, DWORD flags, IDirect3DSurface9 **surface, UINT usage, D3DPOOL pool,
D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, void *user_mem) D3DMULTISAMPLE_TYPE multisample_type, DWORD multisample_quality, void *user_mem)
{ {
struct wined3d_resource *sub_resource;
struct wined3d_resource_desc desc; struct wined3d_resource_desc desc;
struct d3d9_surface *surface_impl; struct d3d9_surface *surface_impl;
struct wined3d_texture *texture; struct wined3d_texture *texture;
...@@ -1142,8 +1141,7 @@ static HRESULT d3d9_device_create_surface(struct d3d9_device *device, UINT width ...@@ -1142,8 +1141,7 @@ static HRESULT d3d9_device_create_surface(struct d3d9_device *device, UINT width
return hr; return hr;
} }
sub_resource = wined3d_texture_get_sub_resource(texture, 0); surface_impl = wined3d_texture_get_sub_resource_parent(texture, 0);
surface_impl = wined3d_resource_get_parent(sub_resource);
surface_impl->parent_device = &device->IDirect3DDevice9Ex_iface; surface_impl->parent_device = &device->IDirect3DDevice9Ex_iface;
*surface = &surface_impl->IDirect3DSurface9_iface; *surface = &surface_impl->IDirect3DSurface9_iface;
IDirect3DSurface9_AddRef(*surface); IDirect3DSurface9_AddRef(*surface);
......
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