2017-10-15 21:38:09 +02:00
|
|
|
#include "d3d11_buffer.h"
|
|
|
|
#include "d3d11_device.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
D3D11Buffer::D3D11Buffer(
|
2017-11-29 16:23:33 +01:00
|
|
|
D3D11Device* device,
|
|
|
|
IDXGIImageResourcePrivate* resource,
|
|
|
|
const D3D11_BUFFER_DESC& desc)
|
|
|
|
: m_device (device),
|
|
|
|
m_resource(resource),
|
|
|
|
m_desc (desc) {
|
2017-11-26 14:01:41 +01:00
|
|
|
|
2017-10-15 21:38:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
D3D11Buffer::~D3D11Buffer() {
|
2017-11-26 14:01:41 +01:00
|
|
|
|
2017-10-15 21:38:09 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
HRESULT D3D11Buffer::QueryInterface(REFIID riid, void** ppvObject) {
|
2017-10-15 21:50:34 +02:00
|
|
|
COM_QUERY_IFACE(riid, ppvObject, IUnknown);
|
|
|
|
COM_QUERY_IFACE(riid, ppvObject, ID3D11DeviceChild);
|
|
|
|
COM_QUERY_IFACE(riid, ppvObject, ID3D11Resource);
|
2017-10-15 21:38:09 +02:00
|
|
|
COM_QUERY_IFACE(riid, ppvObject, ID3D11Buffer);
|
|
|
|
|
2017-11-29 16:23:33 +01:00
|
|
|
if (riid == __uuidof(IDXGIResource)
|
|
|
|
|| riid == __uuidof(IDXGIBufferResourcePrivate))
|
|
|
|
return m_resource->QueryInterface(riid, ppvObject);
|
|
|
|
|
2017-10-15 21:38:09 +02:00
|
|
|
Logger::warn("D3D11Buffer::QueryInterface: Unknown interface query");
|
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void D3D11Buffer::GetDevice(ID3D11Device** ppDevice) {
|
|
|
|
*ppDevice = m_device.ref();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void D3D11Buffer::GetType(D3D11_RESOURCE_DIMENSION* pResourceDimension) {
|
|
|
|
*pResourceDimension = D3D11_RESOURCE_DIMENSION_BUFFER;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void D3D11Buffer::GetDesc(D3D11_BUFFER_DESC* pDesc) {
|
|
|
|
*pDesc = m_desc;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|