diff --git a/dlls/d3d11/d3d11_private.h b/dlls/d3d11/d3d11_private.h index ce4f9655698..c28359e597b 100644 --- a/dlls/d3d11/d3d11_private.h +++ b/dlls/d3d11/d3d11_private.h @@ -186,6 +186,7 @@ struct d3d_rendertarget_view HRESULT d3d_rendertarget_view_create(struct d3d_device *device, ID3D11Resource *resource, const D3D11_RENDER_TARGET_VIEW_DESC *desc, struct d3d_rendertarget_view **view) DECLSPEC_HIDDEN; +struct d3d_rendertarget_view *unsafe_impl_from_ID3D11RenderTargetView(ID3D11RenderTargetView *iface) DECLSPEC_HIDDEN; struct d3d_rendertarget_view *unsafe_impl_from_ID3D10RenderTargetView(ID3D10RenderTargetView *iface) DECLSPEC_HIDDEN; /* ID3D11ShaderResourceView, ID3D10ShaderResourceView */ diff --git a/dlls/d3d11/device.c b/dlls/d3d11/device.c index 4c310beb705..e757169a9ae 100644 --- a/dlls/d3d11/device.c +++ b/dlls/d3d11/device.c @@ -467,8 +467,18 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_CopyStructureCount(ID3D11D static void STDMETHODCALLTYPE d3d11_immediate_context_ClearRenderTargetView(ID3D11DeviceContext *iface, ID3D11RenderTargetView *render_target_view, const FLOAT color_rgba[4]) { - FIXME("iface %p, render_target_view %p, color_rgba {%.8e %.8e %.8e %.8e} stub!\n", + struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface); + struct d3d_rendertarget_view *view = unsafe_impl_from_ID3D11RenderTargetView(render_target_view); + const struct wined3d_color color = {color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]}; + HRESULT hr; + + TRACE("iface %p, render_target_view %p, color_rgba {%.8e %.8e %.8e %.8e}.\n", iface, render_target_view, color_rgba[0], color_rgba[1], color_rgba[2], color_rgba[3]); + + wined3d_mutex_lock(); + if (FAILED(hr = wined3d_device_clear_rendertarget_view(device->wined3d_device, view->wined3d_view, NULL, &color))) + ERR("Failed to clear view, hr %#x.\n", hr); + wined3d_mutex_unlock(); } static void STDMETHODCALLTYPE d3d11_immediate_context_ClearUnorderedAccessViewUint(ID3D11DeviceContext *iface, diff --git a/dlls/d3d11/view.c b/dlls/d3d11/view.c index ce33749081d..f3769b57b55 100644 --- a/dlls/d3d11/view.c +++ b/dlls/d3d11/view.c @@ -1169,6 +1169,15 @@ HRESULT d3d_rendertarget_view_create(struct d3d_device *device, ID3D11Resource * return S_OK; } +struct d3d_rendertarget_view *unsafe_impl_from_ID3D11RenderTargetView(ID3D11RenderTargetView *iface) +{ + if (!iface) + return NULL; + assert(iface->lpVtbl == &d3d11_rendertarget_view_vtbl); + + return impl_from_ID3D11RenderTargetView(iface); +} + struct d3d_rendertarget_view *unsafe_impl_from_ID3D10RenderTargetView(ID3D10RenderTargetView *iface) { if (!iface)