aboutsummaryrefslogtreecommitdiff
path: root/src/capture/kms.c
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2024-09-06 12:41:14 +0200
committerdec05eba <dec05eba@protonmail.com>2024-09-06 12:41:14 +0200
commit954a41de9cde43f68eae0340cc1ed109257f9356 (patch)
tree2556c09a3e53c656fe265c20475476c5c31314a5 /src/capture/kms.c
parent239f2010f5b91117ecd485ac20c541a1e8ecd434 (diff)
Explicit glFlush/glFinish before and after render operations to fix tearing and stutter on amd
Diffstat (limited to 'src/capture/kms.c')
-rw-r--r--src/capture/kms.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/capture/kms.c b/src/capture/kms.c
index ce50d31..bdf3202 100644
--- a/src/capture/kms.c
+++ b/src/capture/kms.c
@@ -515,6 +515,9 @@ static int gsr_capture_kms_capture(gsr_capture *cap, AVFrame *frame, gsr_color_c
if(!capture_is_combined_plane)
capture_pos = (vec2i){drm_fd->x, drm_fd->y};
+ self->params.egl->glFlush();
+ self->params.egl->glFinish();
+
gsr_color_conversion_draw(color_conversion, self->external_texture_fallback ? self->external_input_texture_id : self->input_texture_id,
(vec2i){target_x, target_y}, self->capture_size,
capture_pos, self->capture_size,
@@ -530,8 +533,8 @@ static int gsr_capture_kms_capture(gsr_capture *cap, AVFrame *frame, gsr_color_c
render_drm_cursor(self, color_conversion, cursor_drm_fd, target_x, target_y, texture_rotation);
}
- //self->params.egl->glFlush();
- //self->params.egl->glFinish();
+ self->params.egl->glFlush();
+ self->params.egl->glFinish();
return 0;
}