(10-19-2019, 07:17 AM)Billiard26 Wrote: [ -> ]My progress is here:
https://github.com/dolphin-emu/dolphin/pull/8380
It currently only works with D3D11. The buildbot is having troubles with it so you'll have to build it yourself.
If someone actually has some OpenXR supporting hardware (probably just Windows Mixed Reality) and they want to test and provide feedback I can upload a compiled version.
Well, I'd actually be willing to provide feedback or help with some code/debugging, if that's helpful. I also happen to have a Windows Mixed Reality headset that I can use for testing.
The problem is, however, that I've compiled the PR and tried to get it working, but I can't get past the
xrCreateSession call, whether I use Windows Mixed Reality simulator or my actual headset. Here's the debug output from Visual Studio, attached to a debug build:
Code:
44:41:586 videocommon\postprocessing.cpp:72 E[Video]: Post-processing shader not found: P:\Dolphin\dolphin\Binary\x64/Sys/Shaders/(off).glsl
44:41:620 common\openxr.cpp:137 I[Video]: OpenXR: Available extension: XR_KHR_win32_convert_performance_counter_time
44:41:620 common\openxr.cpp:137 I[Video]: OpenXR: Available extension: XR_KHR_D3D11_enable
44:41:621 common\openxr.cpp:137 I[Video]: OpenXR: Available extension: XR_KHR_composition_layer_depth
44:41:621 common\openxr.cpp:137 I[Video]: OpenXR: Available extension: XR_KHR_visibility_mask
44:41:621 common\openxr.cpp:137 I[Video]: OpenXR: Available extension: XR_MSFT_unbounded_reference_space
44:41:621 common\openxr.cpp:137 I[Video]: OpenXR: Available extension: XR_MSFT_spatial_anchor
44:41:621 common\openxr.cpp:137 I[Video]: OpenXR: Available extension: XR_EXT_debug_utils
44:41:660 common\openxr.cpp:197 I[Video]: OpenXR: Runtime name: Windows Mixed Reality Runtime
44:41:660 common\openxr.cpp:220 I[Video]: OpenXR: System name: Windows Mixed Reality
Exception thrown at 0x00007FFBFDB6A839 in Dolphin.exe: Microsoft C++ exception: wxr::XrResultException at memory location 0x00000067C5EFE6EC.
Exception thrown at 0x00007FFBFDB6A839 in Dolphin.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown at 0x00007FFBFDB6A839 in Dolphin.exe: Microsoft C++ exception: wxr::XrResultException at memory location 0x00000067C5EFE6EC.
47:41:117 common\openxr.cpp:290 E[Video]: OpenXR: xrCreateSession: -1 // XR_ERROR_VALIDATION_FAILURE
Dolphin continues to run the game after that, but since there's no OpenXR session made, there's no changes on the Windows Mixed Reality headset.
Things I've tried:
- Since the error should mean that "the function usage was invalid in some way", I checked if the calls to the other OpenXR functions had valid parameters according to the specs or returned some error that wasn't XR_SUCCESS. Nothing seemed to be off from the specifications to me, and at the breakpoint, no parameter looks invalid either.
- Some lengthy things like compiling OpenXR myself to get debug information and trying
Microsoft's own open-source OpenXR sample to check if my headset and OpenXR was working. The debug build made it output some extra exceptions where things go awry. I also tried adding the "XR_APILAYER_LUNARG_core_validation" OpenXR layer, but couldn't get it to find the layer files. I'll be giving this some more attempts.
Then, I found what is
probably the thing that's causing OpenXR to be upset, at least on my PC since you seem to get output. At least, that's what I assume (I have some OpenGL and Vulkan knowledge, but DirectX isn't something I'm familiar with). There's a line in the Visual Studio's debugger output (before the OpenXR implementation is initialized) that sounds like it's related to the issue I'm having:
DXGI WARNING: IDXGIFactory::CreateSwapChain1 or IDXGISwapChain::SetFullscreenState: Stereo is disabled. [ MISCELLANEOUS WARNING #128: ]
The error appears after
this "CreateSwapChainForHwnd" function is called. It does return S_OK. So, I think that there's some problem here.
Thanks for making this whole OpenXR thing happen, btw! Also, I posted it here instead of the Github PR since I didn't want to send a long message what could very much be PC problems, but I could also post this on the Github PR if that's better. I'll look into doing some code review things, but I'll just leave my problem here for now. If you need more information, videos or whatever, do ask :)