Commit 1b9ce767 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

d3d11: Implement d3d11_immediate_context_ClearRenderTargetView().

parent acd78b54
......@@ -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 */
......
......@@ -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,
......
......@@ -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)
......
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