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/xcomposite.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'src/capture/xcomposite.c') diff --git a/src/capture/xcomposite.c b/src/capture/xcomposite.c index 899ffe0..4c54027 100644 --- a/src/capture/xcomposite.c +++ b/src/capture/xcomposite.c @@ -325,6 +325,9 @@ static int gsr_capture_xcomposite_capture(gsr_capture *cap, AVFrame *frame, gsr_ const int target_x = max_int(0, frame->width / 2 - self->texture_size.x / 2); const int target_y = max_int(0, frame->height / 2 - self->texture_size.y / 2); + self->params.egl->glFlush(); + self->params.egl->glFinish(); + gsr_color_conversion_draw(color_conversion, window_texture_get_opengl_texture_id(&self->window_texture), (vec2i){target_x, target_y}, self->texture_size, (vec2i){0, 0}, self->texture_size, @@ -349,10 +352,8 @@ static int gsr_capture_xcomposite_capture(gsr_capture *cap, AVFrame *frame, gsr_ self->params.egl->glDisable(GL_SCISSOR_TEST); } - // TODO: Do video encoder specific conversion here - - //self->params.egl->glFlush(); - //self->params.egl->glFinish(); + self->params.egl->glFlush(); + self->params.egl->glFinish(); return 0; } -- cgit v1.2.3