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

d3d9: Use wined3d_texture_get_sub_resource_parent() in d3d9_swapchain_GetBackBuffer().

parent 928cb58a
...@@ -152,7 +152,6 @@ static HRESULT WINAPI d3d9_swapchain_GetBackBuffer(IDirect3DSwapChain9Ex *iface, ...@@ -152,7 +152,6 @@ static HRESULT WINAPI d3d9_swapchain_GetBackBuffer(IDirect3DSwapChain9Ex *iface,
UINT backbuffer_idx, D3DBACKBUFFER_TYPE backbuffer_type, IDirect3DSurface9 **backbuffer) UINT backbuffer_idx, D3DBACKBUFFER_TYPE backbuffer_type, IDirect3DSurface9 **backbuffer)
{ {
struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9Ex(iface); struct d3d9_swapchain *swapchain = impl_from_IDirect3DSwapChain9Ex(iface);
struct wined3d_resource *wined3d_resource;
struct wined3d_texture *wined3d_texture; struct wined3d_texture *wined3d_texture;
struct d3d9_surface *surface_impl; struct d3d9_surface *surface_impl;
HRESULT hr = D3D_OK; HRESULT hr = D3D_OK;
...@@ -171,8 +170,7 @@ static HRESULT WINAPI d3d9_swapchain_GetBackBuffer(IDirect3DSwapChain9Ex *iface, ...@@ -171,8 +170,7 @@ static HRESULT WINAPI d3d9_swapchain_GetBackBuffer(IDirect3DSwapChain9Ex *iface,
wined3d_mutex_lock(); wined3d_mutex_lock();
if ((wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, backbuffer_idx))) if ((wined3d_texture = wined3d_swapchain_get_back_buffer(swapchain->wined3d_swapchain, backbuffer_idx)))
{ {
wined3d_resource = wined3d_texture_get_sub_resource(wined3d_texture, 0); surface_impl = wined3d_texture_get_sub_resource_parent(wined3d_texture, 0);
surface_impl = wined3d_resource_get_parent(wined3d_resource);
*backbuffer = &surface_impl->IDirect3DSurface9_iface; *backbuffer = &surface_impl->IDirect3DSurface9_iface;
IDirect3DSurface9_AddRef(*backbuffer); IDirect3DSurface9_AddRef(*backbuffer);
} }
......
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