[d3d11] Implemented FinishCommandList/ExecuteCommandList

This commit is contained in:
Philip Rebohle 2018-03-03 20:59:17 +01:00
parent 3f8c2b0f9c
commit b469cfac0b
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
6 changed files with 31 additions and 14 deletions

View File

@ -48,7 +48,7 @@ namespace dxvk {
}
void D3D11CommandList::EmitToCsThread(const Rc<DxvkCsThread>& CsThread) {
void D3D11CommandList::EmitToCsThread(DxvkCsThread* CsThread) {
for (auto chunk : m_chunks)
CsThread->dispatchChunk(Rc<DxvkCsChunk>(chunk));
}

View File

@ -29,7 +29,7 @@ namespace dxvk {
ID3D11CommandList* pCommandList);
void EmitToCsThread(
const Rc<DxvkCsThread>& CsThread);
DxvkCsThread* CsThread);
private:

View File

@ -2321,6 +2321,11 @@ namespace dxvk {
}
void D3D11DeviceContext::RestoreState() {
Logger::err("D3D11DeviceContext::RestoreState: Not implemented");
}
DxvkDataSlice D3D11DeviceContext::AllocUpdateBufferSlice(size_t Size) {
constexpr size_t UpdateBufferSize = 4 * 1024 * 1024;

View File

@ -562,6 +562,8 @@ namespace dxvk {
void ApplyViewportState();
void RestoreState();
DxvkDataSlice AllocUpdateBufferSlice(size_t Size);
template<typename Cmd>

View File

@ -9,7 +9,7 @@ namespace dxvk {
: D3D11DeviceContext(pParent, Device),
m_contextFlags(ContextFlags),
m_commandList (CreateCommandList()) {
ClearState();
}
@ -31,15 +31,25 @@ namespace dxvk {
void STDMETHODCALLTYPE D3D11DeferredContext::ExecuteCommandList(
ID3D11CommandList* pCommandList,
WINBOOL RestoreContextState) {
Logger::err("D3D11DeferredContext::ExecuteCommandList: Not implemented");
static_cast<D3D11CommandList*>(pCommandList)->EmitToCommandList(m_commandList.ptr());
if (RestoreContextState)
RestoreState();
else
ClearState();
}
HRESULT STDMETHODCALLTYPE D3D11DeferredContext::FinishCommandList(
WINBOOL RestoreDeferredContextState,
ID3D11CommandList **ppCommandList) {
Logger::err("D3D11DeferredContext::FinishCommandList: Not implemented");
return E_NOTIMPL;
*ppCommandList = m_commandList.ref();
m_commandList = CreateCommandList();
if (!RestoreDeferredContextState)
ClearState();
return S_OK;
}

View File

@ -1,3 +1,4 @@
#include "d3d11_cmdlist.h"
#include "d3d11_context_imm.h"
#include "d3d11_device.h"
#include "d3d11_texture.h"
@ -64,7 +65,12 @@ namespace dxvk {
void STDMETHODCALLTYPE D3D11ImmediateContext::ExecuteCommandList(
ID3D11CommandList* pCommandList,
WINBOOL RestoreContextState) {
Logger::err("D3D11ImmediateContext::ExecuteCommandList: Not implemented");
static_cast<D3D11CommandList*>(pCommandList)->EmitToCsThread(&m_csThread);
if (RestoreContextState)
RestoreState();
else
ClearState();
}
@ -142,13 +148,7 @@ namespace dxvk {
// Mapping an image is sadly not as simple as mapping a buffer
// because applications tend to ignore row and layer strides.
// We use a buffer instead and then perform a copy.
D3D11TextureInfo* textureInfo
= GetCommonTextureInfo(pResource);
if (textureInfo->imageBuffer == nullptr) {
Logger::err("D3D11DeviceContext: Cannot map a device-local image");
return E_INVALIDARG;
}
D3D11TextureInfo* textureInfo = GetCommonTextureInfo(pResource);
if (pMappedResource == nullptr)
return S_FALSE;