wined3d: Reject multisampled readbacks in wined3d_surface_get_render_target_data().

This commit is contained in:
Henri Verbeet 2011-10-23 18:23:58 +02:00 committed by Alexandre Julliard
parent 4229d865d2
commit 6e8273177a
5 changed files with 18 additions and 3 deletions

View File

@ -971,8 +971,7 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTargetData(IDirect3DDevice9E
TRACE("iface %p, render_target %p, dst_surface %p.\n", iface, pRenderTarget, pDestSurface);
wined3d_mutex_lock();
hr = wined3d_surface_bltfast(destSurface->wined3d_surface, 0, 0,
renderTarget->wined3d_surface, NULL, WINEDDBLTFAST_NOCOLORKEY);
hr = wined3d_surface_get_render_target_data(destSurface->wined3d_surface, renderTarget->wined3d_surface);
wined3d_mutex_unlock();
return hr;

View File

@ -12644,7 +12644,7 @@ static void multisample_get_rtdata_test(IDirect3DDevice9 *device)
hr = IDirect3DDevice9_Clear(device, 0, NULL, D3DCLEAR_TARGET, 0xff00ff00, 0.0, 0);
ok(SUCCEEDED(hr), "Failed to clear render target, hr %#x.\n", hr);
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);
ok(SUCCEEDED(hr), "Failed to set depth/stencil, hr %#x.\n", hr);

View File

@ -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);
}
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. */
static void surface_remove_pbo(struct wined3d_surface *surface, const struct wined3d_gl_info *gl_info)
{

View File

@ -212,6 +212,7 @@
@ cdecl wined3d_surface_get_parent(ptr)
@ cdecl wined3d_surface_get_pitch(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_getdc(ptr ptr)
@ cdecl wined3d_surface_incref(ptr)

View File

@ -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);
DWORD __cdecl wined3d_surface_get_pitch(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);
HRESULT __cdecl wined3d_surface_getdc(struct wined3d_surface *surface, HDC *dc);
ULONG __cdecl wined3d_surface_incref(struct wined3d_surface *surface);