Swap flush and memory barrier

This commit is contained in:
dec05eba
2025-06-07 11:47:27 +02:00
parent baa7bfd5e4
commit b0b1442a03
4 changed files with 5 additions and 14 deletions

View File

@@ -920,7 +920,6 @@ void gsr_color_conversion_draw(gsr_color_conversion *self, unsigned int texture_
source_position.x += source_pos.x;
source_position.y += source_pos.y;
gsr_color_conversion_draw_graphics(self, texture_id, external_texture, rotation_matrix, source_position, source_size, destination_pos, texture_size, scale, source_color);
// TODO: Is glFlush and glFinish needed here for graphics garbage?
} else {
switch(rotation) {
case GSR_ROT_0:
@@ -955,13 +954,13 @@ void gsr_color_conversion_draw(gsr_color_conversion *self, unsigned int texture_
}
}
self->params.egl->glFlush();
// TODO: Use the minimal barrier required
self->params.egl->glMemoryBarrier(GL_ALL_BARRIER_BITS); // GL_SHADER_IMAGE_ACCESS_BARRIER_BIT
self->params.egl->glUseProgram(0);
gsr_color_conversion_swizzle_reset(self, source_color);
self->params.egl->glBindTexture(texture_target, 0);
self->params.egl->glFlush();
}
void gsr_color_conversion_clear(gsr_color_conversion *self) {

View File

@@ -517,15 +517,7 @@ void gsr_egl_unload(gsr_egl *self) {
}
void gsr_egl_swap_buffers(gsr_egl *self) {
/* This uses less cpu than swap buffer on nvidia */
// TODO: Do these and remove swap
self->glFlush();
// self->glFinish();
// if(self->egl_display) {
// self->eglSwapBuffers(self->egl_display, self->egl_surface);
// } else if(gsr_window_get_display_server(self->window) == GSR_DISPLAY_SERVER_X11) {
// Display *display = gsr_window_get_display(self->window);
// const Window window = (Window)gsr_window_get_window(self->window);
// self->glXSwapBuffers(display, window);
// }
// TODO: Use the minimal barrier required
self->glMemoryBarrier(GL_ALL_BARRIER_BITS); // GL_SHADER_IMAGE_ACCESS_BARRIER_BIT
}