mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-03-15 07:29:17 +01:00
[d3d11] Move D3D10Multithread instance to immediate context
Deferred contexts do not support this.
This commit is contained in:
parent
87b1f9fa2d
commit
86bdda70b4
@ -15,7 +15,6 @@ namespace dxvk {
|
|||||||
: D3D11DeviceChild<ID3D11DeviceContext4>(pParent),
|
: D3D11DeviceChild<ID3D11DeviceContext4>(pParent),
|
||||||
m_contextExt(GetTypedContext()),
|
m_contextExt(GetTypedContext()),
|
||||||
m_annotation(GetTypedContext(), Device),
|
m_annotation(GetTypedContext(), Device),
|
||||||
m_multithread(this, false),
|
|
||||||
m_device (Device),
|
m_device (Device),
|
||||||
m_flags (ContextFlags),
|
m_flags (ContextFlags),
|
||||||
m_staging (Device, StagingBufferSize),
|
m_staging (Device, StagingBufferSize),
|
||||||
@ -62,11 +61,6 @@ namespace dxvk {
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (riid == __uuidof(ID3D10Multithread)) {
|
|
||||||
*ppvObject = ref(&m_multithread);
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
Logger::warn("D3D11DeviceContext::QueryInterface: Unknown interface query");
|
Logger::warn("D3D11DeviceContext::QueryInterface: Unknown interface query");
|
||||||
Logger::warn(str::format(riid));
|
Logger::warn(str::format(riid));
|
||||||
return E_NOINTERFACE;
|
return E_NOINTERFACE;
|
||||||
|
@ -756,15 +756,10 @@ namespace dxvk {
|
|||||||
VkImageLayout OldLayout,
|
VkImageLayout OldLayout,
|
||||||
VkImageLayout NewLayout);
|
VkImageLayout NewLayout);
|
||||||
|
|
||||||
D3D10DeviceLock LockContext() {
|
|
||||||
return m_multithread.AcquireLock();
|
|
||||||
}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
D3D11DeviceContextExt<ContextType> m_contextExt;
|
D3D11DeviceContextExt<ContextType> m_contextExt;
|
||||||
D3D11UserDefinedAnnotation<ContextType> m_annotation;
|
D3D11UserDefinedAnnotation<ContextType> m_annotation;
|
||||||
D3D10Multithread m_multithread;
|
|
||||||
|
|
||||||
Rc<DxvkDevice> m_device;
|
Rc<DxvkDevice> m_device;
|
||||||
|
|
||||||
@ -1124,6 +1119,10 @@ namespace dxvk {
|
|||||||
return static_cast<ContextType*>(this);
|
return static_cast<ContextType*>(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
D3D10DeviceLock LockContext() {
|
||||||
|
return GetTypedContext()->LockContext();
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -79,6 +79,10 @@ namespace dxvk {
|
|||||||
ID3DDeviceContextState* pState,
|
ID3DDeviceContextState* pState,
|
||||||
ID3DDeviceContextState** ppPreviousState);
|
ID3DDeviceContextState** ppPreviousState);
|
||||||
|
|
||||||
|
D3D10DeviceLock LockContext() {
|
||||||
|
return D3D10DeviceLock();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
// Command list that we're recording
|
// Command list that we're recording
|
||||||
|
@ -18,6 +18,7 @@ namespace dxvk {
|
|||||||
: D3D11CommonContext<D3D11ImmediateContext>(pParent, Device, 0, DxvkCsChunkFlag::SingleUse),
|
: D3D11CommonContext<D3D11ImmediateContext>(pParent, Device, 0, DxvkCsChunkFlag::SingleUse),
|
||||||
m_csThread(Device, Device->createContext(DxvkContextType::Primary)),
|
m_csThread(Device, Device->createContext(DxvkContextType::Primary)),
|
||||||
m_maxImplicitDiscardSize(pParent->GetOptions()->maxImplicitDiscardSize),
|
m_maxImplicitDiscardSize(pParent->GetOptions()->maxImplicitDiscardSize),
|
||||||
|
m_multithread(this, false),
|
||||||
m_videoContext(this, Device) {
|
m_videoContext(this, Device) {
|
||||||
EmitCs([
|
EmitCs([
|
||||||
cDevice = m_device,
|
cDevice = m_device,
|
||||||
@ -54,6 +55,11 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE D3D11ImmediateContext::QueryInterface(REFIID riid, void** ppvObject) {
|
HRESULT STDMETHODCALLTYPE D3D11ImmediateContext::QueryInterface(REFIID riid, void** ppvObject) {
|
||||||
|
if (riid == __uuidof(ID3D10Multithread)) {
|
||||||
|
*ppvObject = ref(&m_multithread);
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
if (riid == __uuidof(ID3D11VideoContext)) {
|
if (riid == __uuidof(ID3D11VideoContext)) {
|
||||||
*ppvObject = ref(&m_videoContext);
|
*ppvObject = ref(&m_videoContext);
|
||||||
return S_OK;
|
return S_OK;
|
||||||
|
@ -80,6 +80,10 @@ namespace dxvk {
|
|||||||
void SynchronizeCsThread(
|
void SynchronizeCsThread(
|
||||||
uint64_t SequenceNumber);
|
uint64_t SequenceNumber);
|
||||||
|
|
||||||
|
D3D10DeviceLock LockContext() {
|
||||||
|
return m_multithread.AcquireLock();
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
DxvkCsThread m_csThread;
|
DxvkCsThread m_csThread;
|
||||||
@ -95,6 +99,7 @@ namespace dxvk {
|
|||||||
dxvk::high_resolution_clock::time_point m_lastFlush
|
dxvk::high_resolution_clock::time_point m_lastFlush
|
||||||
= dxvk::high_resolution_clock::now();
|
= dxvk::high_resolution_clock::now();
|
||||||
|
|
||||||
|
D3D10Multithread m_multithread;
|
||||||
D3D11VideoContext m_videoContext;
|
D3D11VideoContext m_videoContext;
|
||||||
Com<D3D11DeviceContextState> m_stateObject;
|
Com<D3D11DeviceContextState> m_stateObject;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user