Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
TheIronWolfModding committed Jul 31, 2024
1 parent c7d43f2 commit 554c657
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
1 change: 1 addition & 0 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ compiler_args = [
'-Wno-missing-field-initializers',
'-Wno-unused-parameter',
'-Wno-cast-function-type', # Needed for GetProcAddress.
'-Wno-unused-but-set-variable', # D3D9 empty lock.
# clang
'-Wno-unused-private-field',
'-Wno-microsoft-exception-spec',
Expand Down
7 changes: 6 additions & 1 deletion src/d3d9/d3d9_device.h
Original file line number Diff line number Diff line change
Expand Up @@ -931,10 +931,15 @@ namespace dxvk {
UINT Stride);

void BindIndices();

#ifdef GTR2_SPECIFIC_D3D9_MULTITHREADED
D3D9DeviceLock LockDevice() {
return m_multithread.AcquireLock();
}
#else
D3D9DeviceLock LockDevice() {
return D3D9DeviceLock();
}
#endif // GTR2_SPECIFIC_D3D9_MULTITHREADED

const D3D9Options* GetOptions() const {
return &m_d3d9Options;
Expand Down
9 changes: 7 additions & 2 deletions src/d3d9/d3d9_multithread.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace dxvk {
* \c std::unique_lock, with the goal of being
* cheaper to construct and destroy.
*/
#ifdef GTR2_SPECIFIC_D3D9_MULTITHREADED
class D3D9DeviceLock {

public:
Expand Down Expand Up @@ -48,7 +49,10 @@ namespace dxvk {
sync::RecursiveSpinlock* m_mutex;

};

#else
struct D3D9DeviceLock
{};
#endif // GTR2_SPECIFIC_D3D9_MULTITHREADED

/**
* \brief D3D9 context lock
Expand All @@ -59,12 +63,13 @@ namespace dxvk {

D3D9Multithread(
BOOL Protected);

#ifdef GTR2_SPECIFIC_D3D9_MULTITHREADED
D3D9DeviceLock AcquireLock() {
return m_protected
? D3D9DeviceLock(m_mutex)
: D3D9DeviceLock();
}
#endif // GTR2_SPECIFIC_D3D9_MULTITHREADED

private:

Expand Down

0 comments on commit 554c657

Please sign in to comment.