This repository was archived by the owner on Jun 3, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -58,6 +58,7 @@ extern idCVar r_forceZPassStencilShadows;
5858extern idCVar r_useStencilShadowPreload;
5959extern idCVar r_singleTriangle;
6060extern idCVar r_useLightDepthBounds;
61+ extern idCVar r_swapInterval;
6162
6263void PrintState ( uint64 stateBits, uint64 * stencilBits );
6364
@@ -682,10 +683,21 @@ ChoosePresentMode
682683=============
683684*/
684685VkPresentModeKHR ChoosePresentMode ( idList< VkPresentModeKHR > & modes ) {
685- const VkPresentModeKHR desiredMode = VK_PRESENT_MODE_MAILBOX_KHR ;
686+ VkPresentModeKHR desiredMode = VK_PRESENT_MODE_FIFO_KHR ;
686687
687- for ( int i = 0 ; i < modes.Num (); ++i ) {
688- if ( modes[ i ] == desiredMode ) {
688+ if (r_swapInterval.GetInteger () < 1 ) {
689+ for (int i = 0 ; i < modes.Num (); i++) {
690+ if (modes[i] == VK_PRESENT_MODE_MAILBOX_KHR) {
691+ return VK_PRESENT_MODE_MAILBOX_KHR;
692+ }
693+ if ((modes[i] != VK_PRESENT_MODE_MAILBOX_KHR) && (modes[i] == VK_PRESENT_MODE_IMMEDIATE_KHR)) {
694+ return VK_PRESENT_MODE_IMMEDIATE_KHR;
695+ }
696+ }
697+ }
698+
699+ for (int i = 0 ; i < modes.Num (); ++i) {
700+ if (modes[i] == desiredMode) {
689701 return desiredMode;
690702 }
691703 }
You can’t perform that action at this time.
0 commit comments