Detegr / openRBRVR

Open source VR implementation for Richard Burns Rally
Mozilla Public License 2.0
35 stars 6 forks source link

32bit to 64bit bridging to support varjo in openxr #21

Open durandom opened 2 months ago

durandom commented 2 months ago

I reached out to Varjo support and asked for a 32bit version of their runtime. Here's the reply:

very interesting project, we unfortunately have 3rd party dependencies also, so it's not just a recompile at the moment so it will be hard for us to prioritize and do it. I do think that only WMR does support the 32-bit runtime, wonder if it would be possible for you to do an interop to 64 bit instead fromt the 32 bit code. Did not try this myself but it might be something to consider. https://learn.microsoft.com/en-us/windows/win32/winprog64/process-interoperability and https://learn.microsoft.com/en-us/windows/win32/winprog64/interprocess-communication have some starting point at least. Please note that I did not try this, so it might not be suitable, just thought I share thoughts.

This is beyond my knowledge, but I think they suggest to make the openxr calls to the 64bit runtime dll via some interop middleware. Maybe this would require a 32bit openxr wrapper dll?! Just wanted to share here, maybe some folks with more knowledge can judge the feasability of this.

Maybe we can even get @mbucchia to weigh in. Sounds like a challenging enough problem :)

Detegr commented 2 months ago

Cool that you actually got an answer that confirms it's not as simple as just rebuilding the runtime, thanks for reaching out to them.

I have no experience of interoperating between 32 and 64-bit code either. I'm a bit afraid the communication and possible marshaling of the data from/to the middleware can possibly be too slow to actually be feasible. Some other problems may arise as well. Then again, OpenXR API calls are pretty simple and there isn't much data to transfer on the API level.

I don't know if this is absolutely nuts to try to implement but a part of me wants to try and see :)

mbucchia commented 2 months ago

The IPC interop solution is something I looked into at some point but is likely very complex to do as you have to proxy many calls. It would be very time consuming. There are also additional challenges that require a lot of knowledge like cross-process texture sharing.

There are many OpenXR runtimes out there supporting 32 bit, in fact only SteamVR and Varjo don't, so it's a poor excuse.

The easiest solution today is probably to take something like VDXR and make it work with VarjoLib (as a wrapper of LibOVR). The complex part for that will be 1) supporting inputs via OpenVR interop and 2) supporting quad layers compositions.

None of this is really worth anybody time IMO. Varjo abandoned non-enterprise consumers, so writing any code for them is a dead end. Your best route is to sell you device and get a better one.

durandom commented 2 months ago

Hey, thanks for looking and leaving your honest reply.

The irony is, that this RBR community builds upon maintaining a discontinued racing simulator. Maybe supporting discontinued headsets is a good fit. Just joking :)