WGL: No double buffering + multi sampling = FAIL?

对着背影说爱祢 提交于 2019-12-04 07:25:07

In theory, drawing in a single-buffer mode means that you're directly modifying what is being presented to the screen (aka the front buffer). Since that memory is in a specific format already, you don't get to choose another one. (I'm saying in theory because the platform does however it pleases it in practice. Aero for example does not allow access to the front-buffer).

Moreover, when doing multisampling, the step that converts the X samples/pixel to 1 pixel for drawing is when the back-buffer is copied to the front buffer (what is called the resolve step). In single buffer mode, there is no such step.

As to your 60 fps locking, you might want to look atWGL_EXT_swap_control. The issue here is that you don't generally want to update what is being shown on screen while the screen refreshes the data; it creates tearing. So by default, Swap only updates while the screen is vertical syncing (aka vsync), so you end up locking to the refresh rate of the screen.

If you don't mind your display showing parts of different frames, you can turn it off.

For completeness, there is an alternative mode called triple buffering, that essentially has the GPU ping-pong rendering between 2 back-buffers while the front buffer is shown. It is up to the gpu to pick the last finished back-buffer when comes time to change what shows on screen (vsync). Sadly, I am not aware of a WGL method to ask for triple buffering.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!