mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-02 13:29:14 +01:00
[d3d11] Implemented FinishCommandList/ExecuteCommandList
This commit is contained in:
parent
3f8c2b0f9c
commit
b469cfac0b
@ -48,7 +48,7 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void D3D11CommandList::EmitToCsThread(const Rc<DxvkCsThread>& CsThread) {
|
void D3D11CommandList::EmitToCsThread(DxvkCsThread* CsThread) {
|
||||||
for (auto chunk : m_chunks)
|
for (auto chunk : m_chunks)
|
||||||
CsThread->dispatchChunk(Rc<DxvkCsChunk>(chunk));
|
CsThread->dispatchChunk(Rc<DxvkCsChunk>(chunk));
|
||||||
}
|
}
|
||||||
|
@ -29,7 +29,7 @@ namespace dxvk {
|
|||||||
ID3D11CommandList* pCommandList);
|
ID3D11CommandList* pCommandList);
|
||||||
|
|
||||||
void EmitToCsThread(
|
void EmitToCsThread(
|
||||||
const Rc<DxvkCsThread>& CsThread);
|
DxvkCsThread* CsThread);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -2321,6 +2321,11 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void D3D11DeviceContext::RestoreState() {
|
||||||
|
Logger::err("D3D11DeviceContext::RestoreState: Not implemented");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
DxvkDataSlice D3D11DeviceContext::AllocUpdateBufferSlice(size_t Size) {
|
DxvkDataSlice D3D11DeviceContext::AllocUpdateBufferSlice(size_t Size) {
|
||||||
constexpr size_t UpdateBufferSize = 4 * 1024 * 1024;
|
constexpr size_t UpdateBufferSize = 4 * 1024 * 1024;
|
||||||
|
|
||||||
|
@ -562,6 +562,8 @@ namespace dxvk {
|
|||||||
|
|
||||||
void ApplyViewportState();
|
void ApplyViewportState();
|
||||||
|
|
||||||
|
void RestoreState();
|
||||||
|
|
||||||
DxvkDataSlice AllocUpdateBufferSlice(size_t Size);
|
DxvkDataSlice AllocUpdateBufferSlice(size_t Size);
|
||||||
|
|
||||||
template<typename Cmd>
|
template<typename Cmd>
|
||||||
|
@ -9,7 +9,7 @@ namespace dxvk {
|
|||||||
: D3D11DeviceContext(pParent, Device),
|
: D3D11DeviceContext(pParent, Device),
|
||||||
m_contextFlags(ContextFlags),
|
m_contextFlags(ContextFlags),
|
||||||
m_commandList (CreateCommandList()) {
|
m_commandList (CreateCommandList()) {
|
||||||
|
ClearState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -31,15 +31,25 @@ namespace dxvk {
|
|||||||
void STDMETHODCALLTYPE D3D11DeferredContext::ExecuteCommandList(
|
void STDMETHODCALLTYPE D3D11DeferredContext::ExecuteCommandList(
|
||||||
ID3D11CommandList* pCommandList,
|
ID3D11CommandList* pCommandList,
|
||||||
WINBOOL RestoreContextState) {
|
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(
|
HRESULT STDMETHODCALLTYPE D3D11DeferredContext::FinishCommandList(
|
||||||
WINBOOL RestoreDeferredContextState,
|
WINBOOL RestoreDeferredContextState,
|
||||||
ID3D11CommandList **ppCommandList) {
|
ID3D11CommandList **ppCommandList) {
|
||||||
Logger::err("D3D11DeferredContext::FinishCommandList: Not implemented");
|
*ppCommandList = m_commandList.ref();
|
||||||
return E_NOTIMPL;
|
m_commandList = CreateCommandList();
|
||||||
|
|
||||||
|
if (!RestoreDeferredContextState)
|
||||||
|
ClearState();
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
#include "d3d11_cmdlist.h"
|
||||||
#include "d3d11_context_imm.h"
|
#include "d3d11_context_imm.h"
|
||||||
#include "d3d11_device.h"
|
#include "d3d11_device.h"
|
||||||
#include "d3d11_texture.h"
|
#include "d3d11_texture.h"
|
||||||
@ -64,7 +65,12 @@ namespace dxvk {
|
|||||||
void STDMETHODCALLTYPE D3D11ImmediateContext::ExecuteCommandList(
|
void STDMETHODCALLTYPE D3D11ImmediateContext::ExecuteCommandList(
|
||||||
ID3D11CommandList* pCommandList,
|
ID3D11CommandList* pCommandList,
|
||||||
WINBOOL RestoreContextState) {
|
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
|
// Mapping an image is sadly not as simple as mapping a buffer
|
||||||
// because applications tend to ignore row and layer strides.
|
// because applications tend to ignore row and layer strides.
|
||||||
// We use a buffer instead and then perform a copy.
|
// We use a buffer instead and then perform a copy.
|
||||||
D3D11TextureInfo* textureInfo
|
D3D11TextureInfo* textureInfo = GetCommonTextureInfo(pResource);
|
||||||
= GetCommonTextureInfo(pResource);
|
|
||||||
|
|
||||||
if (textureInfo->imageBuffer == nullptr) {
|
|
||||||
Logger::err("D3D11DeviceContext: Cannot map a device-local image");
|
|
||||||
return E_INVALIDARG;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (pMappedResource == nullptr)
|
if (pMappedResource == nullptr)
|
||||||
return S_FALSE;
|
return S_FALSE;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user