diff options
author | dec05eba <dec05eba@protonmail.com> | 2024-09-06 12:41:14 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2024-09-06 12:41:14 +0200 |
commit | 954a41de9cde43f68eae0340cc1ed109257f9356 (patch) | |
tree | 2556c09a3e53c656fe265c20475476c5c31314a5 /src/capture/xcomposite.c | |
parent | 239f2010f5b91117ecd485ac20c541a1e8ecd434 (diff) |
Explicit glFlush/glFinish before and after render operations to fix tearing and stutter on amd
Diffstat (limited to 'src/capture/xcomposite.c')
-rw-r--r-- | src/capture/xcomposite.c | 9 |
1 files changed, 5 insertions, 4 deletions
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; } |