ValveSoftware / openvr

OpenVR SDK
http://steamvr.com
BSD 3-Clause "New" or "Revised" License
6.09k stars 1.28k forks source link

bGlFinishHack? #460

Open mlfarrell opened 7 years ago

mlfarrell commented 7 years ago

What's the status of this hack? Have the latest Nvidia drivers resolved it? I really hate the idea of implementing my graphics engine port using a hack.

fschliem commented 7 years ago

I disabled this and it does work without the hack on my R390 and my friend's 1070 (to cover both Nvida and AMD cards). So empirically it should be fixed, but your mileage may vary.

The comment is two years old, but it seems to have been ported everywhere since it was part of the sample code, though it would be nice to see an official release with this solved.

mlfarrell commented 7 years ago

Sounds good. I'm going to leave it off since a forced pipeline stall on VR sounds insanely like a bad idea. Are you on windows? How's your experience with GL performance been using OpenVR sofar? I'm coming from hololens project where I was able to do single-pass stereo rendering so this will be an adjustment for me.

fschliem commented 7 years ago

@mlfarrell - I'm using a Vive on Win10. It really depends on your application, but it pays off to get your bare bones compositor pipeline working well. OpenVR only really cares about getting two textures at 90fps, how you make them is up to you - you can use DX11/12 and Vulkan if you prefer.

In terms of perf, I would look at this: http://media.steampowered.com/apps/valve/2015/Alex_Vlachos_Advanced_VR_Rendering_GDC2015.pdf

... and if you are looking to make OpenGL faster search for ADZO http://www.gdcvault.com/play/1020791/Approaching-Zero-Driver-Overhead-in

I also found useful to look at the frame timing window in the steamvr settings, both for my apps and other ones (The Lab, Google Earth, etc). If you do this to the hello openvr sample and toggle the hack, you get a good feeling on how much it is affecting things.

mnikelsky commented 7 years ago

I can not quite confirm that it is no longer needed. Since SteamVR introduced the asynchronous reprojection we got flickering blackouts in HMD whenever the 90fps could not be reached. You don´t need a full glFinish to fix this though, in our application we were able to fix it by calling glMemoryBarrier(GL_TEXTURE_UPDATE_BARRIER_BIT); directly after calling submit (so before the texture gets cleared for the next frame). To me this feels a bit like a bug in the asynchronous reprojection code since we don´t have this behaviour when using the oculus sdk and mostly identical rendering code in our applications.

@mlfarrell Performance in OpenGL is as good as your rendering code. Depending on your hardware you can utilize extensions for single pass stereo, lens matched shading or VR SLI to get to the 90fps. The forced pipeline stall is not as bad as it seems since you have it anyways due to the requirements of syncing the tracking and rendering. So doing this twice does not really hurt that much.