Browse Source

win-capture: Reset d3d9 capture if device recreated

Fixes a bug where if a D3D9 program recreates its device the capture
would become invalid.  Certain games (especially blizzard games) will
completely recreate their Direct3D device if a critical D3D9 error
occurs.
jp9000 9 years ago
parent
commit
d32424e5ad
1 changed files with 5 additions and 0 deletions
  1. 5 0
      plugins/win-capture/graphics-hook/d3d9-capture.cpp

+ 5 - 0
plugins/win-capture/graphics-hook/d3d9-capture.cpp

@@ -603,6 +603,11 @@ static void d3d9_capture(IDirect3DDevice9 *device,
 		d3d9_init(device);
 	}
 	if (capture_ready()) {
+		if (data.device != device) {
+			d3d9_free();
+			return;
+		}
+
 		if (data.using_shtex)
 			d3d9_shtex_capture(backbuffer);
 		else