[BUG] Black screen when injecting Dead Island 2
This is another one of my crude attempts to fix stuff without really understanding.
Some users (not me) report a black screen injecting Dead Island. Apparently it works with nightly 1026 but not 1027 (and doesn't work with the current nightly either). There's only 1 commit between versions 1026 and 1027:
https://github.com/praydog/UEVR/commit/e77b321e66fea80506e06a05356d40d2ce8718b7
with the current codebase, replacing line 394 of FFakeStereoRenderingHook.cpp: void* result = hook->m_tick_hook.original<void* ()(sdk::UGameEngine, float, bool)>()(engine, delta, idle); with void* result = hook->m_tick_hook.call<void*>(engine, delta, idle);
and line 456 of the same class result = hook->m_tick_hook.original<void* ()(sdk::UGameEngine, float, bool)>()(engine, delta, idle); with result = hook->m_tick_hook.call<void*>(engine, delta, idle);
i.e. reinstating the 1026 hook call in a very naive way, appears to fix it. I don't know why - the e77b321 commit mentioned an unnecessary lock. Perhaps it's not always unnecessary?
using my Guest 3 + OpenXR I am able to repro this issue. Injecting on the latest nightly, and build 1027, results in a black screen. Version 1026 works.
I don't know if it's another example of stack corruption or something similar. The mutex lock on the tick_hook call certainly doesn't look like it's necessary. Could we just have a new option to go back to the locked hook call, i.e.
https://github.com/praydog/UEVR/pull/376
??
Perhaps you can just make this into a PR turning this into an option in the config?
Not sure if this PR is still required:
https://github.com/praydog/UEVR/pull/376
the last couple of nightly builds appear to fix the black screen issue with Dead Island