Nioh 2
Cutscene runs with sound and no picture. Its video is WMV3, which the fix decodes itself where the engine cannot. Runs on DXMT only.
GPL-3.0-or-laterThis fix in MacGameFix
What you see
The cutscene refuses to play, then the game crashes
Why it happens
As in Nioh: no WMV3 decoder in CrossOver, and the shared D3D9 surface the cutscene is presented onto comes back with a null share handle.
What the fix changes
The fix's own WMV3 reader (or a staged decoder), then hand the game a share handle that exists
The code
Wine's d3d9 answers a shared render target with S_OK and a null handle; where it leaves that hole, the bridge hands the game a real shared handle.
fixes/p5s-video-bridge.c ยท my_CreateRenderTarget, lines 1437โ1466c
static HRESULT WINAPI my_CreateRenderTarget(void *self, UINT w, UINT h, DWORD fmt,
DWORD ms, DWORD msq, BOOL lockable,
void **surface, HANDLE *shared)
{
HRESULT hr = real_CreateRenderTarget(self, w, h, fmt, ms, msq, lockable, surface, shared);
note_shared("CreateRenderTarget", w, h, fmt, hr, shared);
/* Only where Wine left a hole: it succeeded and shared nothing. */
if (SUCCEEDED(hr) && shared && !*shared && make_sidecar(w, h))
{
static LONG said;
*shared = sidecar_handle;
sidecar_w = w; sidecar_h = h;
if (surface && *surface)
{
static void *su;
void **vt;
shared_surface = *surface;
vt = *(void ***)shared_surface;
real_SurfUnlock = (HRESULT (WINAPI *)(void *))vt[SLOT_SURF_UNLOCKRECT];
if (!watch_write_path || !patch_slot("surface UnlockRect", shared_surface,
SLOT_SURF_UNLOCKRECT, (void *)my_SurfUnlock, &su))
real_SurfUnlock = NULL;
}
if (InterlockedIncrement(&said) == 1)
logf_(" handed the game a real shared handle %p instead of null -- "
"nothing copies into it yet; this only asks whether the game "
"then carries on", sidecar_handle);
}
return hr;
}Thanks to
- winevideoIndependent confirmation of the shared-texture cutscene path, which winevideo repairs inside a patched Wine d3d9.dll.
Details
- Needs
- DXMT only. The sidecar needs
GetSharedHandle,E_NOTIMPLunder D3DMetal - Installer
- install-nioh-bridge.sh
- Executable
- nioh2.exe
- Built from
- p5s-video-bridge.c, asf-reader.c, wmv-dmo.c, wm-reader.c, dshow-graph.c
- Verified on
- Stable 26.3, on a copy of it carrying this project's
winegstreamer(2026-08-31); CrossOver Preview 27 through NotProton with nothing staged (2026-10-14)