Commit 1e6951cb authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d8: Use wined3d_texture_get_sub_resource_parent() in d3d8_swapchain_GetBackBuffer().

parent bdc31c99
......@@ -112,7 +112,6 @@ static HRESULT WINAPI d3d8_swapchain_GetBackBuffer(IDirect3DSwapChain8 *iface,
UINT backbuffer_idx, D3DBACKBUFFER_TYPE backbuffer_type, IDirect3DSurface8 **backbuffer)
{
struct d3d8_swapchain *swapchain = impl_from_IDirect3DSwapChain8(iface);
struct wined3d_resource *wined3d_resource;
struct wined3d_texture *wined3d_texture;
struct d3d8_surface *surface_impl;
HRESULT hr = D3D_OK;
......@@ -131,8 +130,7 @@ static HRESULT WINAPI d3d8_swapchain_GetBackBuffer(IDirect3DSwapChain8 *iface,
wined3d_mutex_lock();
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_resource_get_parent(wined3d_resource);
surface_impl = wined3d_texture_get_sub_resource_parent(wined3d_texture, 0);
*backbuffer = &surface_impl->IDirect3DSurface8_iface;
IDirect3DSurface8_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