Commit d2fdeaa4 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

d3d10core: Implement d3d10_depthstencil_view_GetResource().

parent de597208
......@@ -128,9 +128,12 @@ struct d3d10_depthstencil_view
{
ID3D10DepthStencilView ID3D10DepthStencilView_iface;
LONG refcount;
ID3D10Resource *resource;
};
HRESULT d3d10_depthstencil_view_init(struct d3d10_depthstencil_view *view) DECLSPEC_HIDDEN;
HRESULT d3d10_depthstencil_view_init(struct d3d10_depthstencil_view *view,
ID3D10Resource *resource) DECLSPEC_HIDDEN;
/* ID3D10RenderTargetView */
struct d3d10_rendertarget_view
......
......@@ -804,8 +804,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilView(ID3D10Devic
return E_OUTOFMEMORY;
}
hr = d3d10_depthstencil_view_init(object);
if (FAILED(hr))
if (FAILED(hr = d3d10_depthstencil_view_init(object, resource)))
{
WARN("Failed to initialize depthstencil view, hr %#x.\n", hr);
HeapFree(GetProcessHeap(), 0, object);
......
......@@ -211,6 +211,7 @@ static ULONG STDMETHODCALLTYPE d3d10_depthstencil_view_Release(ID3D10DepthStenci
if (!refcount)
{
ID3D10Resource_Release(This->resource);
HeapFree(GetProcessHeap(), 0, This);
}
......@@ -255,7 +256,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_view_SetPrivateDataInterface
static void STDMETHODCALLTYPE d3d10_depthstencil_view_GetResource(ID3D10DepthStencilView *iface,
ID3D10Resource **resource)
{
FIXME("iface %p, resource %p stub!\n", iface, resource);
struct d3d10_depthstencil_view *view = impl_from_ID3D10DepthStencilView(iface);
TRACE("iface %p, resource %p.\n", iface, resource);
*resource = view->resource;
ID3D10Resource_AddRef(*resource);
}
/* ID3D10DepthStencilView methods */
......@@ -283,11 +289,15 @@ static const struct ID3D10DepthStencilViewVtbl d3d10_depthstencil_view_vtbl =
d3d10_depthstencil_view_GetDesc,
};
HRESULT d3d10_depthstencil_view_init(struct d3d10_depthstencil_view *view)
HRESULT d3d10_depthstencil_view_init(struct d3d10_depthstencil_view *view,
ID3D10Resource *resource)
{
view->ID3D10DepthStencilView_iface.lpVtbl = &d3d10_depthstencil_view_vtbl;
view->refcount = 1;
view->resource = resource;
ID3D10Resource_AddRef(resource);
return S_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