From bb26e3fd7199be4f2c51090dc207511ecae9d2f4 Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Fri, 28 Aug 2026 22:51:39 +0200 Subject: [PATCH] DEBUG30 fix StateBlock Apply vtable slot --- src/outline/d3d9_hook.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/outline/d3d9_hook.zig b/src/outline/d3d9_hook.zig index 582463d..56f67ba 100644 --- a/src/outline/d3d9_hook.zig +++ b/src/outline/d3d9_hook.zig @@ -363,8 +363,12 @@ fn deviceCreateStateBlock(dev: *anyopaque) ?*anyopaque { } fn stateBlockApply(sb: *anyopaque) bool { + // IDirect3DStateBlock9 vtable: + // 0 QI, 1 AddRef, 2 Release, 3 GetDevice, 4 Capture, 5 Apply. + // DEBUG28/29 accidentally called Capture here, so no captured state was + // ever restored. Use the real Apply slot. const f: *const fn (*anyopaque) callconv(hook.cc.stdcall) i32 = - @ptrFromInt(vt(sb)[4]); + @ptrFromInt(vt(sb)[5]); return f(sb) >= 0; }