diff --git a/dlls/d3d9/device.c b/dlls/d3d9/device.c index 4af6ffbe5d9..16b27e5aca3 100644 --- a/dlls/d3d9/device.c +++ b/dlls/d3d9/device.c @@ -1265,12 +1265,22 @@ static HRESULT WINAPI d3d9_device_GetRenderTargetData(IDirect3DDevice9Ex *iface, { struct d3d9_surface *rt_impl = unsafe_impl_from_IDirect3DSurface9(render_target); struct d3d9_surface *dst_impl = unsafe_impl_from_IDirect3DSurface9(dst_surface); + struct wined3d_resource_desc wined3d_desc; + struct wined3d_resource *sub_resource; HRESULT hr; TRACE("iface %p, render_target %p, dst_surface %p.\n", iface, render_target, dst_surface); wined3d_mutex_lock(); - hr = wined3d_surface_get_render_target_data(dst_impl->wined3d_surface, rt_impl->wined3d_surface); + sub_resource = wined3d_texture_get_sub_resource(rt_impl->wined3d_texture, rt_impl->sub_resource_idx); + wined3d_resource_get_desc(sub_resource, &wined3d_desc); + + /* TODO: Check surface sizes, pools, etc. */ + if (wined3d_desc.multisample_type) + hr = D3DERR_INVALIDCALL; + else + hr = wined3d_texture_blt(dst_impl->wined3d_texture, dst_impl->sub_resource_idx, NULL, + rt_impl->wined3d_texture, rt_impl->sub_resource_idx, NULL, 0, NULL, WINED3D_TEXF_POINT); wined3d_mutex_unlock(); return hr; diff --git a/dlls/wined3d/surface.c b/dlls/wined3d/surface.c index d08259dd313..d0b70f36638 100644 --- a/dlls/wined3d/surface.c +++ b/dlls/wined3d/surface.c @@ -1100,19 +1100,6 @@ static HRESULT wined3d_surface_depth_blt(struct wined3d_surface *src_surface, DW return WINED3D_OK; } -HRESULT CDECL wined3d_surface_get_render_target_data(struct wined3d_surface *surface, - struct wined3d_surface *render_target) -{ - TRACE("surface %p, render_target %p.\n", surface, render_target); - - /* TODO: Check surface sizes, pools, etc. */ - - if (render_target->resource.multisample_type) - return WINED3DERR_INVALIDCALL; - - return wined3d_surface_blt(surface, NULL, render_target, NULL, 0, NULL, WINED3D_TEXF_POINT); -} - /* Context activation is done by the caller. */ static void surface_remove_pbo(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info) { diff --git a/dlls/wined3d/wined3d.spec b/dlls/wined3d/wined3d.spec index 9a266c9c782..67203507a88 100644 --- a/dlls/wined3d/wined3d.spec +++ b/dlls/wined3d/wined3d.spec @@ -225,7 +225,6 @@ @ cdecl wined3d_surface_get_overlay_position(ptr ptr ptr) @ cdecl wined3d_surface_get_parent(ptr) @ cdecl wined3d_surface_get_pitch(ptr) -@ cdecl wined3d_surface_get_render_target_data(ptr ptr) @ cdecl wined3d_surface_get_resource(ptr) @ cdecl wined3d_surface_getdc(ptr ptr) @ cdecl wined3d_surface_incref(ptr) diff --git a/include/wine/wined3d.h b/include/wine/wined3d.h index 6f98c342400..82ad4935318 100644 --- a/include/wine/wined3d.h +++ b/include/wine/wined3d.h @@ -2478,8 +2478,6 @@ struct wined3d_surface * __cdecl wined3d_surface_from_resource(struct wined3d_re HRESULT __cdecl wined3d_surface_get_overlay_position(const struct wined3d_surface *surface, LONG *x, LONG *y); void * __cdecl wined3d_surface_get_parent(const struct wined3d_surface *surface); DWORD __cdecl wined3d_surface_get_pitch(const struct wined3d_surface *surface); -HRESULT __cdecl wined3d_surface_get_render_target_data(struct wined3d_surface *surface, - struct wined3d_surface *render_target); struct wined3d_resource * __cdecl wined3d_surface_get_resource(struct wined3d_surface *surface); HRESULT __cdecl wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc); ULONG __cdecl wined3d_surface_incref(struct wined3d_surface *surface);