Fix cursor flicker on nvidia when capturing monitor

Thanks to David Kleuker for bug testing
This commit is contained in:
dec05eba
2026-01-06 19:35:15 +01:00
parent f1acb95cf3
commit 3117f30143
3 changed files with 6 additions and 1 deletions

View File

@@ -553,6 +553,9 @@ static int gsr_capture_v4l2_capture(gsr_capture *cap, gsr_capture_metadata *capt
const vec2i target_pos = gsr_capture_get_target_position(output_size, capture_metadata);
self->params.egl->glFlush();
// TODO: Use the minimal barrier required
self->params.egl->glMemoryBarrier(GL_ALL_BARRIER_BITS);
// TODO: Remove this?
if(self->params.egl->gpu_info.vendor == GSR_GPU_VENDOR_NVIDIA)
self->params.egl->glFinish();

View File

@@ -781,7 +781,6 @@ static void gsr_color_conversion_draw_graphics(gsr_color_conversion *self, unsig
self->params.egl->glBindBuffer(GL_ARRAY_BUFFER, self->vertex_buffer_object_id);
self->params.egl->glBufferSubData(GL_ARRAY_BUFFER, 0, 24 * sizeof(float), vertices);
// TODO:
switch(source_color) {
case GSR_SOURCE_COLOR_RGB:
case GSR_SOURCE_COLOR_BGR: {

View File

@@ -523,4 +523,7 @@ void gsr_egl_swap_buffers(gsr_egl *self) {
self->glFlush();
// TODO: Use the minimal barrier required
self->glMemoryBarrier(GL_ALL_BARRIER_BITS); // GL_SHADER_IMAGE_ACCESS_BARRIER_BIT
// TODO: This is needed on nvidia because the cursor can flicker otherwise. Find a better solution
if(self->gpu_info.vendor == GSR_GPU_VENDOR_NVIDIA)
self->glFinish();
}