Commit 6e827317 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Reject multisampled readbacks in wined3d_surface_get_render_target_data().

parent 4229d865
...@@ -971,8 +971,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTargetData(IDirect3DDevice9E ...@@ -971,8 +971,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTargetData(IDirect3DDevice9E
TRACE("iface %p, render_target %p, dst_surface %p.\n", iface, pRenderTarget, pDestSurface); TRACE("iface %p, render_target %p, dst_surface %p.\n", iface, pRenderTarget, pDestSurface);
wined3d_mutex_lock(); wined3d_mutex_lock();
hr = wined3d_surface_bltfast(destSurface->wined3d_surface, 0, 0, hr = wined3d_surface_get_render_target_data(destSurface->wined3d_surface, renderTarget->wined3d_surface);
renderTarget->wined3d_surface, NULL, WINEDDBLTFAST_NOCOLORKEY);
wined3d_mutex_unlock(); wined3d_mutex_unlock();
return hr; return hr;
......
...@@ -12644,7 +12644,7 @@ static void multisample_get_rtdata_test(IDirect3DDevice9 *device) ...@@ -12644,7 +12644,7 @@ static void multisample_get_rtdata_test(IDirect3DDevice9 *device)
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ff00, 0.0, 0); hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ff00, 0.0, 0);
ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr);
hr = IDirect3DDevice9_GetRenderTargetData(device, rt, readback); hr = IDirect3DDevice9_GetRenderTargetData(device, rt, readback);
todo_wine ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr); ok(hr == D3DERR_INVALIDCALL, "Got unexpected hr %#x.\n", hr);
hr = IDirect3DDevice9_SetDepthStencilSurface(device, original_ds); hr = IDirect3DDevice9_SetDepthStencilSurface(device, original_ds);
ok(SUCCEEDED(hr), "Failed to set depth/stencil, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to set depth/stencil, hr %#x.\n", hr);
......
...@@ -1826,6 +1826,19 @@ HRESULT CDECL wined3d_surface_bltfast(struct wined3d_surface *dst_surface, DWORD ...@@ -1826,6 +1826,19 @@ HRESULT CDECL wined3d_surface_bltfast(struct wined3d_surface *dst_surface, DWORD
return wined3d_surface_blt(dst_surface, &dst_rect, src_surface, &src_rect, flags, NULL, WINED3DTEXF_POINT); return wined3d_surface_blt(dst_surface, &dst_rect, src_surface, &src_rect, flags, NULL, WINED3DTEXF_POINT);
} }
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, WINED3DTEXF_POINT);
}
/* Context activation is done by the caller. */ /* Context activation is done by the caller. */
static void surface_remove_pbo(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info) static void surface_remove_pbo(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info)
{ {
......
...@@ -212,6 +212,7 @@ ...@@ -212,6 +212,7 @@
@ cdecl wined3d_surface_get_parent(ptr) @ cdecl wined3d_surface_get_parent(ptr)
@ cdecl wined3d_surface_get_pitch(ptr) @ cdecl wined3d_surface_get_pitch(ptr)
@ cdecl wined3d_surface_get_priority(ptr) @ cdecl wined3d_surface_get_priority(ptr)
@ cdecl wined3d_surface_get_render_target_data(ptr ptr)
@ cdecl wined3d_surface_get_resource(ptr) @ cdecl wined3d_surface_get_resource(ptr)
@ cdecl wined3d_surface_getdc(ptr ptr) @ cdecl wined3d_surface_getdc(ptr ptr)
@ cdecl wined3d_surface_incref(ptr) @ cdecl wined3d_surface_incref(ptr)
......
...@@ -2428,6 +2428,8 @@ struct wined3d_palette * __cdecl wined3d_surface_get_palette(const struct wined3 ...@@ -2428,6 +2428,8 @@ struct wined3d_palette * __cdecl wined3d_surface_get_palette(const struct wined3
void * __cdecl wined3d_surface_get_parent(const struct wined3d_surface *surface); void * __cdecl wined3d_surface_get_parent(const struct wined3d_surface *surface);
DWORD __cdecl wined3d_surface_get_pitch(const struct wined3d_surface *surface); DWORD __cdecl wined3d_surface_get_pitch(const struct wined3d_surface *surface);
DWORD __cdecl wined3d_surface_get_priority(const struct wined3d_surface *surface); DWORD __cdecl wined3d_surface_get_priority(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); struct wined3d_resource * __cdecl wined3d_surface_get_resource(struct wined3d_surface *surface);
HRESULT __cdecl wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc); HRESULT __cdecl wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc);
ULONG __cdecl wined3d_surface_incref(struct wined3d_surface *surface); ULONG __cdecl wined3d_surface_incref(struct wined3d_surface *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