From 2ec0495ba516111f24abdd5cfe10cd0abd28e313 Mon Sep 17 00:00:00 2001 From: David Rosca Date: Tue, 11 Jul 2023 18:17:06 +0200 Subject: [PATCH] Export DebugSetLevel and DebugSetMute Fixes stuttering on Linux with Proton/DXVK. Closes #93 --- d3d9ex/Wrapper.h | 16 ++++++++++++++++ d3d9ex/exports.def | 2 ++ 2 files changed, 18 insertions(+) diff --git a/d3d9ex/Wrapper.h b/d3d9ex/Wrapper.h index d05211b..0bb3638 100644 --- a/d3d9ex/Wrapper.h +++ b/d3d9ex/Wrapper.h @@ -78,6 +78,9 @@ class D3D9DLL : public WrapperBase void (WINAPI* D3DPERF_SetOptions)(DWORD dwOptions); void (WINAPI* D3DPERF_SetRegion)(D3DCOLOR col, LPCWSTR wszName); + HRESULT (WINAPI* DebugSetLevel)(DWORD level); + void (WINAPI* DebugSetMute)(void); + bool IsDXVK() { return m_isdxvk; } D3D9DLL() @@ -102,6 +105,9 @@ class D3D9DLL : public WrapperBase StoreAddress(&D3DPERF_SetMarker, "D3DPERF_SetMarker"); StoreAddress(&D3DPERF_SetOptions, "D3DPERF_SetOptions"); StoreAddress(&D3DPERF_SetRegion, "D3DPERF_SetRegion"); + + StoreAddress(&DebugSetLevel, "DebugSetLevel"); + StoreAddress(&DebugSetMute, "DebugSetMute"); } private: @@ -155,4 +161,14 @@ extern "C" { return D3D9DLL::Get().D3DPERF_SetRegion(col, wszName); } + + HRESULT WINAPI _DebugSetLevel(DWORD level) + { + return D3D9DLL::Get().DebugSetLevel(level); + } + + void WINAPI _DebugSetMute() + { + D3D9DLL::Get().DebugSetMute(); + } } diff --git a/d3d9ex/exports.def b/d3d9ex/exports.def index 3266e59..afffd03 100644 --- a/d3d9ex/exports.def +++ b/d3d9ex/exports.def @@ -11,4 +11,6 @@ D3DPERF_SetMarker=_D3DPERF_SetMarker @24 D3DPERF_SetOptions=_D3DPERF_SetOptions @25 D3DPERF_SetRegion=_D3DPERF_SetRegion @26 +DebugSetLevel=_DebugSetLevel @27 +DebugSetMute=_DebugSetMute @28