d3d10core: Implement d3d10_depthstencil_view_GetResource().

This commit is contained in:
Henri Verbeet 2012-09-11 00:27:01 +02:00 committed by Alexandre Julliard
parent de5972081e
commit d2fdeaa4fe
3 changed files with 17 additions and 5 deletions

View File

@ -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

View File

@ -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);

View File

@ -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;
}