mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[d3d11] Move GetType and GetContextFlags to D3D11CommonContext
This commit is contained in:
parent
1d2d712dfb
commit
e49524fcb0
@ -8,12 +8,14 @@ namespace dxvk {
|
||||
D3D11CommonContext<ContextType>::D3D11CommonContext(
|
||||
D3D11Device* pParent,
|
||||
const Rc<DxvkDevice>& Device,
|
||||
UINT ContextFlags,
|
||||
DxvkCsChunkFlags CsFlags)
|
||||
: D3D11DeviceChild<ID3D11DeviceContext4>(pParent),
|
||||
m_contextExt(GetTypedContext()),
|
||||
m_annotation(GetTypedContext(), Device),
|
||||
m_multithread(this, false),
|
||||
m_device (Device),
|
||||
m_flags (ContextFlags),
|
||||
m_staging (Device, StagingBufferSize),
|
||||
m_csFlags (CsFlags),
|
||||
m_csChunk (AllocCsChunk()),
|
||||
@ -69,6 +71,20 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
template<typename ContextType>
|
||||
D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE D3D11CommonContext<ContextType>::GetType() {
|
||||
return IsDeferred
|
||||
? D3D11_DEVICE_CONTEXT_DEFERRED
|
||||
: D3D11_DEVICE_CONTEXT_IMMEDIATE;
|
||||
}
|
||||
|
||||
|
||||
template<typename ContextType>
|
||||
UINT STDMETHODCALLTYPE D3D11CommonContext<ContextType>::GetContextFlags() {
|
||||
return m_flags;
|
||||
}
|
||||
|
||||
|
||||
template<typename ContextType>
|
||||
void STDMETHODCALLTYPE D3D11CommonContext<ContextType>::ClearState() {
|
||||
D3D10DeviceLock lock = LockContext();
|
||||
|
@ -76,6 +76,7 @@ namespace dxvk {
|
||||
D3D11CommonContext(
|
||||
D3D11Device* pParent,
|
||||
const Rc<DxvkDevice>& Device,
|
||||
UINT ContextFlags,
|
||||
DxvkCsChunkFlags CsFlags);
|
||||
|
||||
~D3D11CommonContext();
|
||||
@ -84,6 +85,10 @@ namespace dxvk {
|
||||
REFIID riid,
|
||||
void** ppvObject);
|
||||
|
||||
D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE GetType();
|
||||
|
||||
UINT STDMETHODCALLTYPE GetContextFlags();
|
||||
|
||||
void STDMETHODCALLTYPE ClearState();
|
||||
|
||||
void STDMETHODCALLTYPE DiscardResource(ID3D11Resource *pResource);
|
||||
@ -764,6 +769,7 @@ namespace dxvk {
|
||||
Rc<DxvkDevice> m_device;
|
||||
|
||||
D3D11ContextState m_state;
|
||||
UINT m_flags;
|
||||
|
||||
DxvkStagingBuffer m_staging;
|
||||
Rc<DxvkDataBuffer> m_updateBuffer;
|
||||
|
@ -7,23 +7,12 @@ namespace dxvk {
|
||||
D3D11Device* pParent,
|
||||
const Rc<DxvkDevice>& Device,
|
||||
UINT ContextFlags)
|
||||
: D3D11CommonContext<D3D11DeferredContext>(pParent, Device, GetCsChunkFlags(pParent)),
|
||||
m_contextFlags(ContextFlags),
|
||||
: D3D11CommonContext<D3D11DeferredContext>(pParent, Device, ContextFlags, GetCsChunkFlags(pParent)),
|
||||
m_commandList (CreateCommandList()) {
|
||||
ClearState();
|
||||
}
|
||||
|
||||
|
||||
D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE D3D11DeferredContext::GetType() {
|
||||
return D3D11_DEVICE_CONTEXT_DEFERRED;
|
||||
}
|
||||
|
||||
|
||||
UINT STDMETHODCALLTYPE D3D11DeferredContext::GetContextFlags() {
|
||||
return m_contextFlags;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE D3D11DeferredContext::GetData(
|
||||
ID3D11Asynchronous* pAsync,
|
||||
void* pData,
|
||||
@ -371,7 +360,7 @@ namespace dxvk {
|
||||
|
||||
|
||||
Com<D3D11CommandList> D3D11DeferredContext::CreateCommandList() {
|
||||
return new D3D11CommandList(m_parent, m_contextFlags);
|
||||
return new D3D11CommandList(m_parent, m_flags);
|
||||
}
|
||||
|
||||
|
||||
|
@ -31,10 +31,6 @@ namespace dxvk {
|
||||
const Rc<DxvkDevice>& Device,
|
||||
UINT ContextFlags);
|
||||
|
||||
D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE GetType();
|
||||
|
||||
UINT STDMETHODCALLTYPE GetContextFlags();
|
||||
|
||||
HRESULT STDMETHODCALLTYPE GetData(
|
||||
ID3D11Asynchronous* pAsync,
|
||||
void* pData,
|
||||
@ -86,8 +82,6 @@ namespace dxvk {
|
||||
|
||||
private:
|
||||
|
||||
const UINT m_contextFlags;
|
||||
|
||||
// Command list that we're recording
|
||||
Com<D3D11CommandList> m_commandList;
|
||||
|
||||
|
@ -13,7 +13,7 @@ namespace dxvk {
|
||||
D3D11ImmediateContext::D3D11ImmediateContext(
|
||||
D3D11Device* pParent,
|
||||
const Rc<DxvkDevice>& Device)
|
||||
: D3D11CommonContext<D3D11ImmediateContext>(pParent, Device, DxvkCsChunkFlag::SingleUse),
|
||||
: D3D11CommonContext<D3D11ImmediateContext>(pParent, Device, 0, DxvkCsChunkFlag::SingleUse),
|
||||
m_csThread(Device, Device->createContext(DxvkContextType::Primary)),
|
||||
m_maxImplicitDiscardSize(pParent->GetOptions()->maxImplicitDiscardSize),
|
||||
m_videoContext(this, Device) {
|
||||
@ -61,16 +61,6 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE D3D11ImmediateContext::GetType() {
|
||||
return D3D11_DEVICE_CONTEXT_IMMEDIATE;
|
||||
}
|
||||
|
||||
|
||||
UINT STDMETHODCALLTYPE D3D11ImmediateContext::GetContextFlags() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
HRESULT STDMETHODCALLTYPE D3D11ImmediateContext::GetData(
|
||||
ID3D11Asynchronous* pAsync,
|
||||
void* pData,
|
||||
|
@ -29,10 +29,6 @@ namespace dxvk {
|
||||
REFIID riid,
|
||||
void** ppvObject);
|
||||
|
||||
D3D11_DEVICE_CONTEXT_TYPE STDMETHODCALLTYPE GetType();
|
||||
|
||||
UINT STDMETHODCALLTYPE GetContextFlags();
|
||||
|
||||
HRESULT STDMETHODCALLTYPE GetData(
|
||||
ID3D11Asynchronous* pAsync,
|
||||
void* pData,
|
||||
|
Loading…
x
Reference in New Issue
Block a user