mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-01 07:24:12 +01:00
[d3d11] Added stubs for deferred contexts and command lists
This commit is contained in:
parent
0900dfd0e3
commit
5b1311b71e
37
src/d3d11/d3d11_cmdlist.cpp
Normal file
37
src/d3d11/d3d11_cmdlist.cpp
Normal 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
35
src/d3d11/d3d11_cmdlist.h
Normal 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;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -10,10 +10,10 @@
|
|||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
D3D11DeviceContext::D3D11DeviceContext(
|
D3D11DeviceContext::D3D11DeviceContext(
|
||||||
D3D11Device* parent,
|
D3D11Device* pParent,
|
||||||
Rc<DxvkDevice> device)
|
Rc<DxvkDevice> Device)
|
||||||
: m_parent (parent),
|
: m_parent (pParent),
|
||||||
m_device (device),
|
m_device (Device),
|
||||||
m_csChunk (new DxvkCsChunk()) {
|
m_csChunk (new DxvkCsChunk()) {
|
||||||
// Create default state objects. We won't ever return them
|
// Create default state objects. We won't ever return them
|
||||||
// to the application, but we'll use them to apply state.
|
// to the application, but we'll use them to apply state.
|
||||||
|
@ -17,8 +17,8 @@ namespace dxvk {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
D3D11DeviceContext(
|
D3D11DeviceContext(
|
||||||
D3D11Device* parent,
|
D3D11Device* pParent,
|
||||||
Rc<DxvkDevice> device);
|
Rc<DxvkDevice> Device);
|
||||||
~D3D11DeviceContext();
|
~D3D11DeviceContext();
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE QueryInterface(
|
HRESULT STDMETHODCALLTYPE QueryInterface(
|
||||||
|
67
src/d3d11/d3d11_context_def.cpp
Normal file
67
src/d3d11/d3d11_context_def.cpp
Normal 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() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
49
src/d3d11/d3d11_context_def.h
Normal file
49
src/d3d11/d3d11_context_def.h
Normal 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;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
@ -5,10 +5,10 @@
|
|||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
D3D11ImmediateContext::D3D11ImmediateContext(
|
D3D11ImmediateContext::D3D11ImmediateContext(
|
||||||
D3D11Device* parent,
|
D3D11Device* pParent,
|
||||||
Rc<DxvkDevice> device)
|
Rc<DxvkDevice> Device)
|
||||||
: D3D11DeviceContext(parent, device),
|
: D3D11DeviceContext(pParent, Device),
|
||||||
m_csThread(device->createContext()) {
|
m_csThread(Device->createContext()) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -9,8 +9,8 @@ namespace dxvk {
|
|||||||
public:
|
public:
|
||||||
|
|
||||||
D3D11ImmediateContext(
|
D3D11ImmediateContext(
|
||||||
D3D11Device* parent,
|
D3D11Device* pParent,
|
||||||
Rc<DxvkDevice> device);
|
Rc<DxvkDevice> Device);
|
||||||
~D3D11ImmediateContext();
|
~D3D11ImmediateContext();
|
||||||
|
|
||||||
ULONG STDMETHODCALLTYPE AddRef() final;
|
ULONG STDMETHODCALLTYPE AddRef() final;
|
||||||
@ -50,7 +50,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
void SynchronizeDevice();
|
void SynchronizeDevice();
|
||||||
|
|
||||||
void EmitCsChunk();
|
void EmitCsChunk() final;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
#include "d3d11_buffer.h"
|
#include "d3d11_buffer.h"
|
||||||
#include "d3d11_class_linkage.h"
|
#include "d3d11_class_linkage.h"
|
||||||
|
#include "d3d11_context_def.h"
|
||||||
#include "d3d11_context_imm.h"
|
#include "d3d11_context_imm.h"
|
||||||
#include "d3d11_device.h"
|
#include "d3d11_device.h"
|
||||||
#include "d3d11_input_layout.h"
|
#include "d3d11_input_layout.h"
|
||||||
@ -1095,8 +1096,8 @@ namespace dxvk {
|
|||||||
HRESULT STDMETHODCALLTYPE D3D11Device::CreateDeferredContext(
|
HRESULT STDMETHODCALLTYPE D3D11Device::CreateDeferredContext(
|
||||||
UINT ContextFlags,
|
UINT ContextFlags,
|
||||||
ID3D11DeviceContext** ppDeferredContext) {
|
ID3D11DeviceContext** ppDeferredContext) {
|
||||||
Logger::err("D3D11Device::CreateDeferredContext: Not implemented");
|
*ppDeferredContext = ref(new D3D11DeferredContext(this, m_dxvkDevice, ContextFlags));
|
||||||
return E_NOTIMPL;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -2,7 +2,9 @@ d3d11_src = [
|
|||||||
'd3d11_blend.cpp',
|
'd3d11_blend.cpp',
|
||||||
'd3d11_buffer.cpp',
|
'd3d11_buffer.cpp',
|
||||||
'd3d11_class_linkage.cpp',
|
'd3d11_class_linkage.cpp',
|
||||||
|
'd3d11_cmdlist.cpp',
|
||||||
'd3d11_context.cpp',
|
'd3d11_context.cpp',
|
||||||
|
'd3d11_context_def.cpp',
|
||||||
'd3d11_context_imm.cpp',
|
'd3d11_context_imm.cpp',
|
||||||
'd3d11_depth_stencil.cpp',
|
'd3d11_depth_stencil.cpp',
|
||||||
'd3d11_device.cpp',
|
'd3d11_device.cpp',
|
||||||
|
Loading…
Reference in New Issue
Block a user