2018-01-23 09:23:31 +01:00
|
|
|
#include "d3d11_cmdlist.h"
|
|
|
|
#include "d3d11_device.h"
|
|
|
|
|
|
|
|
namespace dxvk {
|
|
|
|
|
|
|
|
D3D11CommandList::D3D11CommandList(
|
|
|
|
D3D11Device* pDevice,
|
|
|
|
UINT ContextFlags)
|
|
|
|
: m_device (pDevice),
|
|
|
|
m_contextFlags(ContextFlags) { }
|
|
|
|
|
|
|
|
|
|
|
|
D3D11CommandList::~D3D11CommandList() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
HRESULT STDMETHODCALLTYPE D3D11CommandList::QueryInterface(REFIID riid, void** ppvObject) {
|
2018-04-02 12:52:02 +02:00
|
|
|
*ppvObject = nullptr;
|
|
|
|
|
|
|
|
if (riid == __uuidof(IUnknown)
|
|
|
|
|| riid == __uuidof(ID3D11DeviceChild)
|
|
|
|
|| riid == __uuidof(ID3D11CommandList)) {
|
|
|
|
*ppvObject = ref(this);
|
|
|
|
return S_OK;
|
|
|
|
}
|
2018-01-23 09:23:31 +01:00
|
|
|
|
|
|
|
Logger::warn("D3D11CommandList::QueryInterface: Unknown interface query");
|
2018-03-12 12:05:43 +01:00
|
|
|
Logger::warn(str::format(riid));
|
2018-01-23 09:23:31 +01:00
|
|
|
return E_NOINTERFACE;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void STDMETHODCALLTYPE D3D11CommandList::GetDevice(ID3D11Device **ppDevice) {
|
|
|
|
*ppDevice = ref(m_device);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-01-23 12:16:28 +01:00
|
|
|
UINT STDMETHODCALLTYPE D3D11CommandList::GetContextFlags() {
|
2018-01-23 09:23:31 +01:00
|
|
|
return m_contextFlags;
|
|
|
|
}
|
|
|
|
|
2018-01-23 12:03:26 +01:00
|
|
|
|
2018-04-03 19:52:14 +02:00
|
|
|
void D3D11CommandList::AddChunk(
|
2018-06-04 23:31:49 +02:00
|
|
|
Rc<DxvkCsChunk>&& Chunk) {
|
2018-01-23 12:03:26 +01:00
|
|
|
m_chunks.push_back(std::move(Chunk));
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void D3D11CommandList::EmitToCommandList(ID3D11CommandList* pCommandList) {
|
|
|
|
auto cmdList = static_cast<D3D11CommandList*>(pCommandList);
|
|
|
|
|
2018-04-28 01:14:57 +02:00
|
|
|
for (const auto& chunk : m_chunks)
|
2018-01-23 12:03:26 +01:00
|
|
|
cmdList->m_chunks.push_back(chunk);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-03-03 20:59:17 +01:00
|
|
|
void D3D11CommandList::EmitToCsThread(DxvkCsThread* CsThread) {
|
2018-04-28 01:14:57 +02:00
|
|
|
for (const auto& chunk : m_chunks)
|
2018-01-23 12:03:26 +01:00
|
|
|
CsThread->dispatchChunk(Rc<DxvkCsChunk>(chunk));
|
|
|
|
}
|
|
|
|
|
2018-01-23 09:23:31 +01:00
|
|
|
}
|