DEBUG30 fix StateBlock Apply vtable slot

This commit is contained in:
2026-08-28 22:51:39 +02:00
parent 7fcd97c5fa
commit bb26e3fd71
+5 -1
View File
@@ -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;
}