Skip to content

Commit

Permalink
Fixed some games inheriting SK's hardware cursor after the cursor mov…
Browse files Browse the repository at this point in the history
…es off of SK's UI
  • Loading branch information
Kaldaien committed Dec 28, 2024
1 parent 28b9101 commit 2c577db
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
7 changes: 6 additions & 1 deletion CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
24.12.27.3
24.12.28
========
+ Fixed some games inheriting SK's hardware cursor after the cursor
moves off of SK's UI.

24.12.27.3
==========
+ Load ReShade Early plug-ins as early as possible (after INI parse)
+ Optimized various state block and UI code
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 27
#define SK_REV_N 3
#define SK_REV 3
#define SK_DATE 28
#define SK_REV_N 0
#define SK_REV 0

#ifndef _A2
#define _A2(a) #a
Expand Down
22 changes: 14 additions & 8 deletions src/render/dxgi/dxgi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,18 @@ SK_DXGI_FeatureLevelsToStr ( int FeatureLevels,
}


#define __NIER_HACK
//
// In order to make DXGI Flip Model promotion work, sometimes it is necessary
// to reuse SwapChains because the game has not destroyed the original
// SwapChain before creating a new one...
//
// It was never required in the original DXGI Blt Model that an HWND have
// only one SwapChain at a time, so games that do this are not necessarily
// broken.
//
// * This compat hack is only needed in D3D11, and only rarely.
//
#define SK_DXGI_RECYCLE_SWAPCHAINS

UINT SK_DXGI_FixUpLatencyWaitFlag (gsl::not_null <IDXGISwapChain*> pSwapChainRaw, UINT Flags, BOOL bCreation = FALSE);

Expand Down Expand Up @@ -1535,11 +1546,6 @@ SK_DXGI_UpdateSwapChain (IDXGISwapChain* This)

if ( SUCCEEDED (This->GetDevice (IID_PPV_ARGS (&pDev.p))) )
{
// These operations are not atomic / cache coherent in
// ReShade (bug!!), so to avoid prematurely freeing
// this stuff don't release and re-acquire a
// reference to the same object.

if (! pDev.IsEqualObject (rb.device))
{
rb.d3d11.immediate_ctx = nullptr;
Expand Down Expand Up @@ -6325,7 +6331,7 @@ DXGIFactory_CreateSwapChain_Override (
new_desc.OutputWindow, nullptr, pDevice, pDev12.p != nullptr
);

#ifdef __NIER_HACK
#ifdef SK_DXGI_RECYCLE_SWAPCHAINS
static SK_ComPtr <IDXGISwapChain> pSwapToRecycle = nullptr;

auto descCopy = *pDesc;
Expand Down Expand Up @@ -6499,7 +6505,7 @@ DXGIFactory_CreateSwapChain_Override (
pTemp->GetDesc (pOrigDesc);
}

#ifdef __NIER_HACK
#ifdef SK_DXGI_RECYCLE_SWAPCHAINS
if ( SK_DXGI_IsFlipModelSwapChain (new_desc) &&
(! SK_DXGI_IsFlipModelSwapChain (descCopy)) )
{
Expand Down

0 comments on commit 2c577db

Please sign in to comment.