Skip to content

Commit

Permalink
Speed up render context re-initialization following a window resize
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaldaien committed Dec 15, 2024
1 parent bc7ac9b commit cb0240a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 40 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
24.12.15.4
24.12.16
========
+ Improve HID->XInput timestamp management when threads are updating the state
concurrently.
+ Fix potential crash while games poll keyboard input from multiple threads
and SK's primary render context is not active.
+ Speed up render context re-initialization following a window resize.

24.12.15.4
==========
+ Revert recent changes to Sleepless Window Thread that could hurt framerate.
+ Unset most hooked window management trampoline functions during shutdown.
Expand Down
6 changes: 3 additions & 3 deletions include/SpecialK/DLL_VERSION.H
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

#define SK_YEAR 24
#define SK_MONTH 12
#define SK_DATE 15
#define SK_REV_N 4
#define SK_REV 4
#define SK_DATE 16
#define SK_REV_N 0
#define SK_REV 0

#ifndef _A2
#define _A2(a) #a
Expand Down
36 changes: 0 additions & 36 deletions src/render/dxgi/dxgi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4658,42 +4658,6 @@ STDMETHODCALLTYPE
DXGISwap_ResizeTarget_Override ( IDXGISwapChain *This,
_In_ const DXGI_MODE_DESC *pNewTargetParameters )
{
// Avoid IDXGISwapChain::ResizeTarget (...) when appropriate, in favor of
// the simpler and much more likely to succeed without disrupting MPOs,
// IDXGISwapChain::ResizeBuffers (...).
BOOL bFullscreen = FALSE;
if (SUCCEEDED (This->GetFullscreenState (&bFullscreen, nullptr)) && bFullscreen == FALSE)
{
DXGI_SWAP_CHAIN_DESC
swapDesc = {};
This->GetDesc (&swapDesc);

if (pNewTargetParameters->RefreshRate.Numerator == 0)
{
SK_LOGi0 (
L"Replacing unnecessary call to IDXGISwapChain::ResizeTarget (...) "
L"with an equivalent call to IDXGISwapChain::ResizeBuffers (...)"
);

HRESULT hr_early =
DXGISwap_ResizeBuffers_Override ( This,
swapDesc.BufferCount, pNewTargetParameters->Width,
pNewTargetParameters->Height,
pNewTargetParameters->Format,
swapDesc.Flags );

if (SUCCEEDED (hr_early))
{
return hr_early;
}

else
{
SK_LOGi0 (L"Substituted API failed with HRESULT=%x!", hr_early);
}
}
}

DXGI_LOG_CALL_I6 (
L" IDXGISwapChain", L"ResizeTarget ",
L"{ (%ux%u@%3.1f Hz),"
Expand Down

0 comments on commit cb0240a

Please sign in to comment.