Commit 739a9d98 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Return WINED3DERR_NOTFOUND if the render target is NULL in…

wined3d: Return WINED3DERR_NOTFOUND if the render target is NULL in wined3d_device_get_render_target(). This is similar to how wined3d_device_get_depth_stencil() works.
parent 918f0a29
......@@ -1142,24 +1142,19 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetRenderTarget(IDirect3DDevice9Ex *i
}
wined3d_mutex_lock();
hr = wined3d_device_get_render_target(This->wined3d_device, RenderTargetIndex, &wined3d_surface);
if (FAILED(hr))
{
FIXME("Call to IWineD3DDevice_GetRenderTarget failed, hr %#x\n", hr);
}
else if (!wined3d_surface)
{
*ppRenderTarget = NULL;
}
else
if (SUCCEEDED(hr))
{
*ppRenderTarget = wined3d_surface_get_parent(wined3d_surface);
IDirect3DSurface9_AddRef(*ppRenderTarget);
wined3d_surface_decref(wined3d_surface);
}
else
{
if (hr != WINED3DERR_NOTFOUND)
WARN("Failed to get render target %u, hr %#x.\n", RenderTargetIndex, hr);
*ppRenderTarget = NULL;
}
wined3d_mutex_unlock();
return hr;
......
......@@ -5119,11 +5119,13 @@ HRESULT CDECL wined3d_device_get_render_target(struct wined3d_device *device,
}
*render_target = device->fb.render_targets[render_target_idx];
if (*render_target)
wined3d_surface_incref(*render_target);
TRACE("Returning render target %p.\n", *render_target);
if (!*render_target)
return WINED3DERR_NOTFOUND;
wined3d_surface_incref(*render_target);
return WINED3D_OK;
}
......
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