[d3d11] Added stubs for deferred contexts and command lists

This commit is contained in:
Philip Rebohle 2018-01-23 09:23:31 +01:00
parent 0900dfd0e3
commit 5b1311b71e
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
10 changed files with 206 additions and 15 deletions

View File

@ -0,0 +1,37 @@
#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) {
COM_QUERY_IFACE(riid, ppvObject, IUnknown);
COM_QUERY_IFACE(riid, ppvObject, ID3D11DeviceChild);
COM_QUERY_IFACE(riid, ppvObject, ID3D11CommandList);
Logger::warn("D3D11CommandList::QueryInterface: Unknown interface query");
return E_NOINTERFACE;
}
void STDMETHODCALLTYPE D3D11CommandList::GetDevice(ID3D11Device **ppDevice) {
*ppDevice = ref(m_device);
}
UINT D3D11CommandList::GetContextFlags() {
return m_contextFlags;
}
}

35
src/d3d11/d3d11_cmdlist.h Normal file
View File

@ -0,0 +1,35 @@
#pragma once
#include "d3d11_device_child.h"
namespace dxvk {
class D3D11Device;
class D3D11CommandList : public D3D11DeviceChild<ID3D11CommandList> {
public:
D3D11CommandList(
D3D11Device* pDevice,
UINT ContextFlags);
~D3D11CommandList();
HRESULT STDMETHODCALLTYPE QueryInterface(
REFIID riid,
void** ppvObject) final;
void STDMETHODCALLTYPE GetDevice(
ID3D11Device **ppDevice) final;
UINT GetContextFlags();
private:
D3D11Device* const m_device;
UINT const m_contextFlags;
};
}

View File

@ -10,10 +10,10 @@
namespace dxvk {
D3D11DeviceContext::D3D11DeviceContext(
D3D11Device* parent,
Rc<DxvkDevice> device)
: m_parent (parent),
m_device (device),
D3D11Device* pParent,
Rc<DxvkDevice> Device)
: m_parent (pParent),
m_device (Device),
m_csChunk (new DxvkCsChunk()) {
// Create default state objects. We won't ever return them
// to the application, but we'll use them to apply state.

View File

@ -17,8 +17,8 @@ namespace dxvk {
public:
D3D11DeviceContext(
D3D11Device* parent,
Rc<DxvkDevice> device);
D3D11Device* pParent,
Rc<DxvkDevice> Device);
~D3D11DeviceContext();
HRESULT STDMETHODCALLTYPE QueryInterface(

View File

@ -0,0 +1,67 @@
#include "d3d11_context_def.h"
namespace dxvk {
D3D11DeferredContext::D3D11DeferredContext(
D3D11Device* pParent,
Rc<DxvkDevice> Device,
UINT ContextFlags)
: D3D11DeviceContext(pParent, Device),
m_contextFlags(ContextFlags) {
}
D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE D3D11DeferredContext::GetType() {
return D3D11_DEVICE_CONTEXT_DEFERRED;
}
UINT STDMETHODCALLTYPE D3D11DeferredContext::GetContextFlags() {
return m_contextFlags;
}
void STDMETHODCALLTYPE D3D11DeferredContext::Flush() {
Logger::err("D3D11: Flush called on a deferred context");
}
void STDMETHODCALLTYPE D3D11DeferredContext::ExecuteCommandList(
ID3D11CommandList* pCommandList,
WINBOOL RestoreContextState) {
Logger::err("D3D11DeferredContext::ExecuteCommandList: Not implemented");
}
HRESULT STDMETHODCALLTYPE D3D11DeferredContext::FinishCommandList(
WINBOOL RestoreDeferredContextState,
ID3D11CommandList **ppCommandList) {
Logger::err("D3D11DeferredContext::FinishCommandList: Not implemented");
return E_NOTIMPL;
}
HRESULT STDMETHODCALLTYPE D3D11DeferredContext::Map(
ID3D11Resource* pResource,
UINT Subresource,
D3D11_MAP MapType,
UINT MapFlags,
D3D11_MAPPED_SUBRESOURCE* pMappedResource) {
Logger::err("D3D11DeferredContext::Map: Not implemented");
return E_NOTIMPL;
}
void STDMETHODCALLTYPE D3D11DeferredContext::Unmap(
ID3D11Resource* pResource,
UINT Subresource) {
Logger::err("D3D11DeferredContext::Unmap: Not implemented");
}
void D3D11DeferredContext::EmitCsChunk() {
}
}

View File

@ -0,0 +1,49 @@
#pragma once
#include "d3d11_context.h"
namespace dxvk {
class D3D11DeferredContext : public D3D11DeviceContext {
public:
D3D11DeferredContext(
D3D11Device* pParent,
Rc<DxvkDevice> Device,
UINT ContextFlags);
D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE GetType() final;
UINT STDMETHODCALLTYPE GetContextFlags() final;
void STDMETHODCALLTYPE Flush() final;
void STDMETHODCALLTYPE ExecuteCommandList(
ID3D11CommandList* pCommandList,
WINBOOL RestoreContextState) final;
HRESULT STDMETHODCALLTYPE FinishCommandList(
WINBOOL RestoreDeferredContextState,
ID3D11CommandList **ppCommandList) final;
HRESULT STDMETHODCALLTYPE Map(
ID3D11Resource* pResource,
UINT Subresource,
D3D11_MAP MapType,
UINT MapFlags,
D3D11_MAPPED_SUBRESOURCE* pMappedResource) final;
void STDMETHODCALLTYPE Unmap(
ID3D11Resource* pResource,
UINT Subresource) final;
private:
const UINT m_contextFlags;
void EmitCsChunk() final;
};
}

View File

@ -5,10 +5,10 @@
namespace dxvk {
D3D11ImmediateContext::D3D11ImmediateContext(
D3D11Device* parent,
Rc<DxvkDevice> device)
: D3D11DeviceContext(parent, device),
m_csThread(device->createContext()) {
D3D11Device* pParent,
Rc<DxvkDevice> Device)
: D3D11DeviceContext(pParent, Device),
m_csThread(Device->createContext()) {
}

View File

@ -9,8 +9,8 @@ namespace dxvk {
public:
D3D11ImmediateContext(
D3D11Device* parent,
Rc<DxvkDevice> device);
D3D11Device* pParent,
Rc<DxvkDevice> Device);
~D3D11ImmediateContext();
ULONG STDMETHODCALLTYPE AddRef() final;
@ -50,7 +50,7 @@ namespace dxvk {
void SynchronizeDevice();
void EmitCsChunk();
void EmitCsChunk() final;
};

View File

@ -2,6 +2,7 @@
#include "d3d11_buffer.h"
#include "d3d11_class_linkage.h"
#include "d3d11_context_def.h"
#include "d3d11_context_imm.h"
#include "d3d11_device.h"
#include "d3d11_input_layout.h"
@ -1095,8 +1096,8 @@ namespace dxvk {
HRESULT STDMETHODCALLTYPE D3D11Device::CreateDeferredContext(
UINT ContextFlags,
ID3D11DeviceContext** ppDeferredContext) {
Logger::err("D3D11Device::CreateDeferredContext: Not implemented");
return E_NOTIMPL;
*ppDeferredContext = ref(new D3D11DeferredContext(this, m_dxvkDevice, ContextFlags));
return S_OK;
}

View File

@ -2,7 +2,9 @@ d3d11_src = [
'd3d11_blend.cpp',
'd3d11_buffer.cpp',
'd3d11_class_linkage.cpp',
'd3d11_cmdlist.cpp',
'd3d11_context.cpp',
'd3d11_context_def.cpp',
'd3d11_context_imm.cpp',
'd3d11_depth_stencil.cpp',
'd3d11_device.cpp',