From 954a41de9cde43f68eae0340cc1ed109257f9356 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 6 Sep 2024 12:41:14 +0200 Subject: Explicit glFlush/glFinish before and after render operations to fix tearing and stutter on amd --- src/capture/kms.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/capture/kms.c') 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; } -- cgit v1.2.3