d3d10core: Implement d3d10_depthstencil_view_GetResource().
This commit is contained in:
parent
de5972081e
commit
d2fdeaa4fe
@ -128,9 +128,12 @@ struct d3d10_depthstencil_view
|
|||||||
{
|
{
|
||||||
ID3D10DepthStencilView ID3D10DepthStencilView_iface;
|
ID3D10DepthStencilView ID3D10DepthStencilView_iface;
|
||||||
LONG refcount;
|
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 */
|
/* ID3D10RenderTargetView */
|
||||||
struct d3d10_rendertarget_view
|
struct d3d10_rendertarget_view
|
||||||
|
@ -804,8 +804,7 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateDepthStencilView(ID3D10Devic
|
|||||||
return E_OUTOFMEMORY;
|
return E_OUTOFMEMORY;
|
||||||
}
|
}
|
||||||
|
|
||||||
hr = d3d10_depthstencil_view_init(object);
|
if (FAILED(hr = d3d10_depthstencil_view_init(object, resource)))
|
||||||
if (FAILED(hr))
|
|
||||||
{
|
{
|
||||||
WARN("Failed to initialize depthstencil view, hr %#x.\n", hr);
|
WARN("Failed to initialize depthstencil view, hr %#x.\n", hr);
|
||||||
HeapFree(GetProcessHeap(), 0, object);
|
HeapFree(GetProcessHeap(), 0, object);
|
||||||
|
@ -211,6 +211,7 @@ static ULONG STDMETHODCALLTYPE d3d10_depthstencil_view_Release(ID3D10DepthStenci
|
|||||||
|
|
||||||
if (!refcount)
|
if (!refcount)
|
||||||
{
|
{
|
||||||
|
ID3D10Resource_Release(This->resource);
|
||||||
HeapFree(GetProcessHeap(), 0, This);
|
HeapFree(GetProcessHeap(), 0, This);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -255,7 +256,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_depthstencil_view_SetPrivateDataInterface
|
|||||||
static void STDMETHODCALLTYPE d3d10_depthstencil_view_GetResource(ID3D10DepthStencilView *iface,
|
static void STDMETHODCALLTYPE d3d10_depthstencil_view_GetResource(ID3D10DepthStencilView *iface,
|
||||||
ID3D10Resource **resource)
|
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 */
|
/* ID3D10DepthStencilView methods */
|
||||||
@ -283,11 +289,15 @@ static const struct ID3D10DepthStencilViewVtbl d3d10_depthstencil_view_vtbl =
|
|||||||
d3d10_depthstencil_view_GetDesc,
|
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->ID3D10DepthStencilView_iface.lpVtbl = &d3d10_depthstencil_view_vtbl;
|
||||||
view->refcount = 1;
|
view->refcount = 1;
|
||||||
|
|
||||||
|
view->resource = resource;
|
||||||
|
ID3D10Resource_AddRef(resource);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user