Commit 526c4612 authored by Józef Kucia's avatar Józef Kucia Committed by Alexandre Julliard

d3d11: Implement d3d11_immediate_context_ClearDepthStencilView().

parent 3ae4be86
......@@ -67,6 +67,7 @@ DWORD wined3d_usage_from_d3d11(UINT bind_flags, enum D3D11_USAGE usage) DECLSPEC
struct wined3d_resource *wined3d_resource_from_d3d11_resource(ID3D11Resource *resource) DECLSPEC_HIDDEN;
struct wined3d_resource *wined3d_resource_from_d3d10_resource(ID3D10Resource *resource) DECLSPEC_HIDDEN;
DWORD wined3d_map_flags_from_d3d11_map_type(D3D11_MAP map_type) DECLSPEC_HIDDEN;
DWORD wined3d_clear_flags_from_d3d11_clear_flags(UINT clear_flags) DECLSPEC_HIDDEN;
enum D3D11_USAGE d3d11_usage_from_d3d10_usage(enum D3D10_USAGE usage) DECLSPEC_HIDDEN;
enum D3D10_USAGE d3d10_usage_from_d3d11_usage(enum D3D11_USAGE usage) DECLSPEC_HIDDEN;
......
......@@ -905,7 +905,7 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ClearRenderTargetView(ID3D
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",
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();
......@@ -932,8 +932,21 @@ static void STDMETHODCALLTYPE d3d11_immediate_context_ClearUnorderedAccessViewFl
static void STDMETHODCALLTYPE d3d11_immediate_context_ClearDepthStencilView(ID3D11DeviceContext *iface,
ID3D11DepthStencilView *depth_stencil_view, UINT flags, FLOAT depth, UINT8 stencil)
{
FIXME("iface %p, depth_stencil_view %p, flags %#x, depth %f, stencil %u stub!\n",
struct d3d_device *device = device_from_immediate_ID3D11DeviceContext(iface);
struct d3d_depthstencil_view *view = unsafe_impl_from_ID3D11DepthStencilView(depth_stencil_view);
DWORD wined3d_flags;
HRESULT hr;
TRACE("iface %p, depth_stencil_view %p, flags %#x, depth %.8e, stencil %u.\n",
iface, depth_stencil_view, flags, depth, stencil);
wined3d_flags = wined3d_clear_flags_from_d3d11_clear_flags(flags);
wined3d_mutex_lock();
if (FAILED(hr = wined3d_device_clear_rendertarget_view(device->wined3d_device, view->wined3d_view, NULL,
wined3d_flags, NULL, depth, stencil)))
ERR("Failed to clear view, hr %#x.\n", hr);
wined3d_mutex_unlock();
}
static void STDMETHODCALLTYPE d3d11_immediate_context_GenerateMips(ID3D11DeviceContext *iface,
......
......@@ -593,6 +593,24 @@ DWORD wined3d_map_flags_from_d3d11_map_type(D3D11_MAP map_type)
}
}
DWORD wined3d_clear_flags_from_d3d11_clear_flags(UINT clear_flags)
{
DWORD wined3d_clear_flags = 0;
if (clear_flags & D3D11_CLEAR_DEPTH)
wined3d_clear_flags |= WINED3DCLEAR_ZBUFFER;
if (clear_flags & D3D11_CLEAR_STENCIL)
wined3d_clear_flags |= WINED3DCLEAR_STENCIL;
if (clear_flags & ~(D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL))
{
FIXME("Unhandled clear flags %#x.\n",
clear_flags & ~(D3D11_CLEAR_DEPTH | D3D11_CLEAR_STENCIL));
}
return wined3d_clear_flags;
}
HRESULT d3d_get_private_data(struct wined3d_private_store *store,
REFGUID guid, UINT *data_size, void *data)
{
......
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