2023-08-11 15:46:37 +00:00
|
|
|
From 075da47d122522b66dc87528199a8aaf363309aa Mon Sep 17 00:00:00 2001
|
|
|
|
From: Johnny on Flame <johnnyonflame@hotmail.com>
|
|
|
|
Date: Sun, 6 Aug 2023 20:55:04 +0000
|
|
|
|
Subject: [PATCH 2/7] Force VSync when using KMSDRM.
|
|
|
|
|
|
|
|
---
|
|
|
|
src/video/SDL_egl.c | 2 +-
|
|
|
|
src/video/kmsdrm/SDL_kmsdrmopengles.c | 1 +
|
|
|
|
2 files changed, 2 insertions(+), 1 deletion(-)
|
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
diff --git a/src/video/SDL_egl.c b/src/video/SDL_egl.c
|
2023-08-11 15:46:37 +00:00
|
|
|
index 8e5f165b5..e270429b1 100644
|
2022-02-05 14:23:32 +00:00
|
|
|
--- a/src/video/SDL_egl.c
|
|
|
|
+++ b/src/video/SDL_egl.c
|
2023-08-11 15:46:37 +00:00
|
|
|
@@ -1044,7 +1044,7 @@ SDL_GLContext SDL_EGL_CreateContext(_THIS, EGLSurface egl_surface)
|
2022-02-05 14:23:32 +00:00
|
|
|
return NULL;
|
|
|
|
}
|
2023-08-11 15:46:37 +00:00
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
- _this->egl_data->egl_swapinterval = 0;
|
|
|
|
+ _this->egl_data->egl_swapinterval = 1;
|
2023-08-11 15:46:37 +00:00
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
if (SDL_EGL_MakeCurrent(_this, egl_surface, egl_context) < 0) {
|
2023-08-11 15:46:37 +00:00
|
|
|
/* Delete the context */
|
2022-02-05 14:23:32 +00:00
|
|
|
diff --git a/src/video/kmsdrm/SDL_kmsdrmopengles.c b/src/video/kmsdrm/SDL_kmsdrmopengles.c
|
2023-08-11 15:46:37 +00:00
|
|
|
index 8dc2bfdc6..487168203 100644
|
2022-02-05 14:23:32 +00:00
|
|
|
--- a/src/video/kmsdrm/SDL_kmsdrmopengles.c
|
|
|
|
+++ b/src/video/kmsdrm/SDL_kmsdrmopengles.c
|
2023-08-11 15:46:37 +00:00
|
|
|
@@ -76,6 +76,7 @@ SDL_EGL_CreateContext_impl(KMSDRM)
|
2022-02-05 14:23:32 +00:00
|
|
|
return SDL_SetError("EGL not initialized");
|
|
|
|
}
|
2023-08-11 15:46:37 +00:00
|
|
|
|
2022-02-05 14:23:32 +00:00
|
|
|
+ interval = 1;
|
|
|
|
if (interval == 0 || interval == 1) {
|
|
|
|
_this->egl_data->egl_swapinterval = interval;
|
|
|
|
} else {
|
2023-08-11 15:46:37 +00:00
|
|
|
--
|
|
|
|
2.20.1
|
|
|
|
|