2018-01-11 12:23:55 +01:00
|
|
|
#include "d3d11_device.h"
|
2018-02-05 22:35:23 +01:00
|
|
|
#include "d3d11_view_uav.h"
|
2018-01-11 12:23:55 +01:00
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
D3D11UnorderedAccessView::D3D11UnorderedAccessView(
|
|
|
|
D3D11Device* device,
|
|
|
|
ID3D11Resource* resource,
|
|
|
|
const D3D11_UNORDERED_ACCESS_VIEW_DESC& desc,
|
|
|
|
const Rc<DxvkBufferView>& bufferView,
|
|
|
|
const DxvkBufferSlice& counterSlice)
|
|
|
|
: m_device(device), m_resource(resource),
|
|
|
|
m_desc(desc), m_bufferView(bufferView),
|
|
|
|
m_counterSlice(counterSlice) { }
|
|
|
|
|
|
|
|
|
|
|
|
D3D11UnorderedAccessView::D3D11UnorderedAccessView(
|
|
|
|
D3D11Device* device,
|
|
|
|
ID3D11Resource* resource,
|
|
|
|
const D3D11_UNORDERED_ACCESS_VIEW_DESC& desc,
|
|
|
|
const Rc<DxvkImageView>& imageView,
|
|
|
|
const DxvkBufferSlice& counterSlice)
|
|
|
|
: m_device(device), m_resource(resource),
|
|
|
|
m_desc(desc), m_imageView(imageView),
|
|
|
|
m_counterSlice(counterSlice) { }
|
|
|
|
|
|
|
|
|
|
|
|
D3D11UnorderedAccessView::~D3D11UnorderedAccessView() {
|
2018-01-18 18:33:13 +01:00
|
|
|
if (m_counterSlice.defined())
|
2018-01-11 12:23:55 +01:00
|
|
|
m_device->FreeCounterSlice(m_counterSlice);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE D3D11UnorderedAccessView::QueryInterface(REFIID riid, void** ppvObject) {
|
|
|
|
COM_QUERY_IFACE(riid, ppvObject, IUnknown);
|
|
|
|
COM_QUERY_IFACE(riid, ppvObject, ID3D11DeviceChild);
|
|
|
|
COM_QUERY_IFACE(riid, ppvObject, ID3D11View);
|
|
|
|
COM_QUERY_IFACE(riid, ppvObject, ID3D11UnorderedAccessView);
|
|
|
|
|
2018-02-05 22:35:23 +01:00
|
|
|
Logger::warn("D3D11UnorderedAccessView::QueryInterface: Unknown interface query");
|
2018-01-11 12:23:55 +01:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void STDMETHODCALLTYPE D3D11UnorderedAccessView::GetDevice(ID3D11Device** ppDevice) {
|
|
|
|
*ppDevice = m_device.ref();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void STDMETHODCALLTYPE D3D11UnorderedAccessView::GetResource(ID3D11Resource** ppResource) {
|
|
|
|
*ppResource = m_resource.ref();
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void STDMETHODCALLTYPE D3D11UnorderedAccessView::GetDesc(D3D11_UNORDERED_ACCESS_VIEW_DESC* pDesc) {
|
|
|
|
*pDesc = m_desc;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|