-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Description
any project that uses bgfx including the sample projects have very bad frame lag that you can do absolutely nothing about (apart from turning off vsync), making it practically unusable for realtime applications with vsync enabled.
the problem is only the number of active command buffers is limited by BGFX_CONFIG_MAX_FRAME_LATENCY, but when a command buffer submits, that doesn't mean the frame has been presented or about to be presented. So you're submitting command buffers one after another in the while game loop and overflowing the CAMetalLayer*'s 4 drawable limit and then the application halts when next drawable is called for the drawable to free up, then you enqueue that drawable at the very back. you have to use 'addPresentedHandler' or 'drawable.presentedTime' to actually set a frames in flight limit, and its also a very good idea to use CVDisplayLink or NSView.displayLink to also reduce latency. If you do this you'd have perfect synchronisation with the os mouse, but right now its very unresponsive