Commit 070f516f authored by Steve Lhomme's avatar Steve Lhomme Committed by Jean-Baptiste Kempf

d3d11_fmt: add D3D11_ReleaseDevice()

Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 44a778a9
......@@ -130,6 +130,21 @@ int AllocateShaderView(vlc_object_t *obj, ID3D11Device *d3ddevice,
return VLC_SUCCESS;
}
void D3D11_ReleaseDevice(d3d11_device_t *d3d_dev)
{
if (d3d_dev->d3dcontext)
{
ID3D11DeviceContext_Flush(d3d_dev->d3dcontext);
ID3D11DeviceContext_Release(d3d_dev->d3dcontext);
d3d_dev->d3dcontext = NULL;
}
if (d3d_dev->d3ddevice)
{
ID3D11Device_Release(d3d_dev->d3ddevice);
d3d_dev->d3ddevice = NULL;
}
}
#undef D3D11_CreateDevice
HRESULT D3D11_CreateDevice(vlc_object_t *obj, d3d11_handle_t *hd3d,
bool hw_decoding, d3d11_device_t *out)
......
......@@ -86,6 +86,8 @@ HRESULT D3D11_CreateDevice(vlc_object_t *obj, d3d11_handle_t *,
bool hw_decoding, d3d11_device_t *out);
#define D3D11_CreateDevice(a,b,c,d) D3D11_CreateDevice( VLC_OBJECT(a), b, c, d )
void D3D11_ReleaseDevice(d3d11_device_t *);
bool isXboxHardware(ID3D11Device *d3ddev);
bool isNvidiaHardware(ID3D11Device *d3ddev);
IDXGIAdapter *D3D11DeviceAdapter(ID3D11Device *d3ddev);
......
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