2017-11-27 15:52:24 +01:00
|
|
|
#include "d3d11_device.h"
|
|
|
|
#include "d3d11_texture.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
D3D11Texture2D::D3D11Texture2D(
|
2017-11-29 15:16:07 +01:00
|
|
|
D3D11Device* device,
|
|
|
|
IDXGIImageResourcePrivate* resource,
|
|
|
|
const D3D11_TEXTURE2D_DESC& desc)
|
|
|
|
: m_device (device),
|
|
|
|
m_resource(resource),
|
|
|
|
m_desc (desc) {
|
2017-11-27 15:52:24 +01:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
D3D11Texture2D::~D3D11Texture2D() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
HRESULT D3D11Texture2D::QueryInterface(REFIID riid, void** ppvObject) {
|
|
|
|
COM_QUERY_IFACE(riid, ppvObject, IUnknown);
|
2017-11-29 16:23:33 +01:00
|
|
|
COM_QUERY_IFACE(riid, ppvObject, ID3D11DeviceChild);
|
2017-11-27 15:52:24 +01:00
|
|
|
COM_QUERY_IFACE(riid, ppvObject, ID3D11Resource);
|
|
|
|
COM_QUERY_IFACE(riid, ppvObject, ID3D11Texture2D);
|
|
|
|
|
2017-11-29 15:16:07 +01:00
|
|
|
if (riid == __uuidof(IDXGIResource)
|
|
|
|
|| riid == __uuidof(IDXGIImageResourcePrivate))
|
|
|
|
return m_resource->QueryInterface(riid, ppvObject);
|
|
|
|
|
2017-11-27 15:52:24 +01:00
|
|
|
Logger::warn("D3D11Texture2D::QueryInterface: Unknown interface query");
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void D3D11Texture2D::GetDevice(ID3D11Device** ppDevice) {
|
|
|
|
*ppDevice = m_device.ref();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void D3D11Texture2D::GetType(D3D11_RESOURCE_DIMENSION *pResourceDimension) {
|
|
|
|
*pResourceDimension = D3D11_RESOURCE_DIMENSION_TEXTURE2D;
|
|
|
|
}
|
|
|
|
|
2017-11-29 07:55:44 +01:00
|
|
|
|
2017-11-29 15:16:07 +01:00
|
|
|
UINT D3D11Texture2D::GetEvictionPriority() {
|
|
|
|
UINT EvictionPriority = DXGI_RESOURCE_PRIORITY_NORMAL;
|
|
|
|
m_resource->GetEvictionPriority(&EvictionPriority);
|
|
|
|
return EvictionPriority;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void D3D11Texture2D::SetEvictionPriority(UINT EvictionPriority) {
|
|
|
|
m_resource->SetEvictionPriority(EvictionPriority);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-11-27 15:52:24 +01:00
|
|
|
void D3D11Texture2D::GetDesc(D3D11_TEXTURE2D_DESC *pDesc) {
|
|
|
|
*pDesc = m_desc;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|