graphics: address perf issues with DX9 image resize logic (#712)

## Link to GitHub Issue or related Pull Request, if one exists
n/a

## Description of change
Move resize logic from `EndScene` to `Present`/`PresentEx` (resolves
Live2D frame drops in some extreme settings)

Plug small memory leak

Remove unnecessary surface Lock/Unlock

## Testing
Tested IIDX, SDVX, DDR.
This commit is contained in:
bicarus
2026-05-29 09:33:31 -07:00
committed by GitHub
parent 0511dfb6ca
commit 0209b80a22
4 changed files with 41 additions and 35 deletions
@@ -35,6 +35,10 @@ static const GUID IID_WrappedIDirect3DDevice9 = {
0x6dec0d40, 0x1339, 0x4bda, { 0xa5, 0xf2, 0x22, 0x31, 0xd4, 0x1, 0xf, 0xd1 }
};
// applies the image resize / orientation swap by copying the back buffer through an
// oversized intermediate surface and back. expects the real (unwrapped) device.
void SurfaceHook(IDirect3DDevice9 *pReal);
struct WrappedIDirect3DDevice9 : IDirect3DDevice9Ex {
explicit WrappedIDirect3DDevice9(HWND hFocusWindow, IDirect3DDevice9 *orig)
: hFocusWindow(hFocusWindow), pReal(orig), is_d3d9ex(false) {