-
Notifications
You must be signed in to change notification settings - Fork 415
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding check and test for triple buffering #1931
Adding check and test for triple buffering #1931
Conversation
Hi @mark-lunarg, I bumped into a previous issue: Based on that, is it sufficient to check minImageCount only to determine whether double buffering is being used? |
@SzilardPapp-Arm, I'm not too current on swapchains, but maybe we should warn if they asked for fewer images than GetSwapchainImagesKHR returned, or if they didn't call GetSwapchainImagesKHR at all? If you want to keep this check, you could just skip it if Mailbox mode is asked for? In what way is this check ARM-specific? |
The scope of this check would be only to recommend using triple buffering over double buffering if someone is into performance on those circumstances I mentioned in the warning. First I thought that if minImageCount is 2, that means we are using double buffering, but I'm not sure anymore which condition(s) has/have to met to be able to determine this. |
I don't think this is an Arm-specific check, see threads here and here. From the point of view of this check, it does not matter if the application is using more images than the developer asked for. If the developer asks for 2 images, it is the layer's job to flag that using less than 3 images might have an impact on performance. |
We are happy with the current implementation. |
Running through internal CI. |
Touched up commit msgs and pushed to Master -- Thanks @SzilardPapp-Arm, hopefully the first of many. |
@mark-lunarg |
I have a complaint about this recommendation, as it is incomplete. Triple buffering can improve performance only if the frame rendering times are both close to the vsync time and very inconsistent. A clearer way to word the suggestion would be to explain that double buffering requires one frame to be rendered during each vsync in order to keep up with the display refresh rate, while triple buffering requires two frames to be rendered during two vsyncs to keep up. If your frame render times are consistently longer than the vsync time, triple buffering will NOT help you. All you gain is extra latency. You really need each long-render frame to alternate with short-render frames. Since this scenario is not very likely, I question your pushing the triple buffering on everyone. I'd imagine most gamers would prefer lower latency over eliminating an occasional stutter. |
Adding a check to determine if double buffering is being used and recommend using triple buffering instead if it's more suitable for the application.
message:
"Warning: A Swapchain is being created with minImageCount set to 2, which means double buffering is going to be used. Using double buffering and vsync locks rendering to an integer fraction of the vsync rate. In turn, reducing the performance of the application if rendering is slower than vsync. Consider setting minImageCount to 3 to use triple buffering to maximize performance in such cases."