mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-21 13:54:18 +01:00
Revert "[d3d10] Implement ID3D10Multithread"
This reverts commit 55d6eae210b72fdc83180ac26f95ef51f563b6b8. We probably don't need it, and the current implementation is broken.
This commit is contained in:
parent
8630ee235a
commit
8172d347be
@ -8,7 +8,7 @@ namespace dxvk {
|
|||||||
D3D10Device::D3D10Device(
|
D3D10Device::D3D10Device(
|
||||||
D3D11Device* pDevice,
|
D3D11Device* pDevice,
|
||||||
D3D11ImmediateContext* pContext)
|
D3D11ImmediateContext* pContext)
|
||||||
: m_device(pDevice), m_context(pContext), m_multithread(this) {
|
: m_device(pDevice), m_context(pContext) {
|
||||||
// Respecting the single-threaded flag may improve performance
|
// Respecting the single-threaded flag may improve performance
|
||||||
UINT flags = pDevice->GetCreationFlags();
|
UINT flags = pDevice->GetCreationFlags();
|
||||||
m_threadSafe = !(flags & D3D10_CREATE_DEVICE_SINGLETHREADED);
|
m_threadSafe = !(flags & D3D10_CREATE_DEVICE_SINGLETHREADED);
|
||||||
|
@ -1,9 +1,12 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "d3d10_multithread.h"
|
#include "d3d10_include.h"
|
||||||
|
|
||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
|
using D3D10DeviceMutex = sync::Spinlock;
|
||||||
|
using D3D10DeviceLock = std::unique_lock<D3D10DeviceMutex>;
|
||||||
|
|
||||||
class D3D11Device;
|
class D3D11Device;
|
||||||
class D3D11ImmediateContext;
|
class D3D11ImmediateContext;
|
||||||
|
|
||||||
@ -470,10 +473,6 @@ namespace dxvk {
|
|||||||
UINT* pWidth,
|
UINT* pWidth,
|
||||||
UINT* pHeight);
|
UINT* pHeight);
|
||||||
|
|
||||||
D3D10Multithread* GetMultithreadIface() {
|
|
||||||
return &m_multithread;
|
|
||||||
}
|
|
||||||
|
|
||||||
D3D10DeviceLock LockDevice() {
|
D3D10DeviceLock LockDevice() {
|
||||||
return m_threadSafe
|
return m_threadSafe
|
||||||
? D3D10DeviceLock(m_mutex)
|
? D3D10DeviceLock(m_mutex)
|
||||||
@ -485,7 +484,6 @@ namespace dxvk {
|
|||||||
D3D10DeviceMutex m_mutex;
|
D3D10DeviceMutex m_mutex;
|
||||||
D3D11Device* m_device;
|
D3D11Device* m_device;
|
||||||
D3D11ImmediateContext* m_context;
|
D3D11ImmediateContext* m_context;
|
||||||
D3D10Multithread m_multithread;
|
|
||||||
|
|
||||||
bool m_threadSafe = true;
|
bool m_threadSafe = true;
|
||||||
|
|
||||||
|
@ -1,42 +0,0 @@
|
|||||||
#include "d3d10_multithread.h"
|
|
||||||
#include "d3d10_device.h"
|
|
||||||
|
|
||||||
namespace dxvk {
|
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE D3D10Multithread::QueryInterface(
|
|
||||||
REFIID riid,
|
|
||||||
void** ppvObject) {
|
|
||||||
return m_device->QueryInterface(riid, ppvObject);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ULONG STDMETHODCALLTYPE D3D10Multithread::AddRef() {
|
|
||||||
return m_device->AddRef();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
ULONG STDMETHODCALLTYPE D3D10Multithread::Release() {
|
|
||||||
return m_device->Release();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void STDMETHODCALLTYPE D3D10Multithread::Enter() {
|
|
||||||
m_lock = m_device->LockDevice();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void STDMETHODCALLTYPE D3D10Multithread::Leave() {
|
|
||||||
m_lock.unlock();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BOOL STDMETHODCALLTYPE D3D10Multithread::GetMultithreadProtected() {
|
|
||||||
return m_enabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
BOOL STDMETHODCALLTYPE D3D10Multithread::SetMultithreadProtected(BOOL Enable) {
|
|
||||||
return std::exchange(m_enabled, Enable);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,43 +0,0 @@
|
|||||||
#pragma once
|
|
||||||
|
|
||||||
#include "d3d10_include.h"
|
|
||||||
|
|
||||||
namespace dxvk {
|
|
||||||
|
|
||||||
using D3D10DeviceMutex = sync::Spinlock;
|
|
||||||
using D3D10DeviceLock = std::unique_lock<D3D10DeviceMutex>;
|
|
||||||
|
|
||||||
class D3D10Device;
|
|
||||||
|
|
||||||
class D3D10Multithread : public ID3D10Multithread {
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
D3D10Multithread(D3D10Device* pDevice)
|
|
||||||
: m_device(pDevice) { }
|
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE QueryInterface(
|
|
||||||
REFIID riid,
|
|
||||||
void** ppvObject);
|
|
||||||
|
|
||||||
ULONG STDMETHODCALLTYPE AddRef();
|
|
||||||
|
|
||||||
ULONG STDMETHODCALLTYPE Release();
|
|
||||||
|
|
||||||
void STDMETHODCALLTYPE Enter();
|
|
||||||
|
|
||||||
void STDMETHODCALLTYPE Leave();
|
|
||||||
|
|
||||||
BOOL STDMETHODCALLTYPE GetMultithreadProtected();
|
|
||||||
|
|
||||||
BOOL STDMETHODCALLTYPE SetMultithreadProtected(BOOL Enable);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
D3D10Device* m_device;
|
|
||||||
D3D10DeviceLock m_lock;
|
|
||||||
bool m_enabled = true;
|
|
||||||
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
@ -61,11 +61,6 @@ namespace dxvk {
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (riid == __uuidof(ID3D10Multithread)) {
|
|
||||||
*ppvObject = ref(m_d3d11Device->GetD3D10Interface()->GetMultithreadIface());
|
|
||||||
return S_OK;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (riid == __uuidof(ID3D11Device)
|
if (riid == __uuidof(ID3D11Device)
|
||||||
|| riid == __uuidof(ID3D11Device1)) {
|
|| riid == __uuidof(ID3D11Device1)) {
|
||||||
*ppvObject = ref(m_d3d11Device);
|
*ppvObject = ref(m_d3d11Device);
|
||||||
|
@ -4,7 +4,6 @@ d3d10_src = [
|
|||||||
'../d3d10/d3d10_depth_stencil.cpp',
|
'../d3d10/d3d10_depth_stencil.cpp',
|
||||||
'../d3d10/d3d10_device.cpp',
|
'../d3d10/d3d10_device.cpp',
|
||||||
'../d3d10/d3d10_input_layout.cpp',
|
'../d3d10/d3d10_input_layout.cpp',
|
||||||
'../d3d10/d3d10_multithread.cpp',
|
|
||||||
'../d3d10/d3d10_query.cpp',
|
'../d3d10/d3d10_query.cpp',
|
||||||
'../d3d10/d3d10_rasterizer.cpp',
|
'../d3d10/d3d10_rasterizer.cpp',
|
||||||
'../d3d10/d3d10_sampler.cpp',
|
'../d3d10/d3d10_sampler.cpp',
|
||||||
|
Loading…
x
Reference in New Issue
Block a user