Преглед изворни кода

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 година
родитељ
комит
d32424e5ad
1 измењених фајлова са 5 додато и 0 уклоњено
  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);
 		d3d9_init(device);
 	}
 	}
 	if (capture_ready()) {
 	if (capture_ready()) {
+		if (data.device != device) {
+			d3d9_free();
+			return;
+		}
+
 		if (data.using_shtex)
 		if (data.using_shtex)
 			d3d9_shtex_capture(backbuffer);
 			d3d9_shtex_capture(backbuffer);
 		else
 		else