Skip to content

Commit

Permalink
flush
Browse files Browse the repository at this point in the history
  • Loading branch information
sagudev committed Feb 10, 2025
1 parent 332bb18 commit 19c9ac6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 4 additions & 0 deletions src/platform/generic/egl/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ use crate::egl::types::{EGLConfig, EGLContext, EGLDisplay, EGLSurface, EGLint};
use crate::surface::Framebuffer;
use crate::{ContextAttributeFlags, ContextAttributes, ContextID, Error, GLApi, GLVersion};
use crate::{Gl, SurfaceInfo};
use glow::HasContext;

use std::ffi::CString;
use std::mem;
Expand Down Expand Up @@ -214,6 +215,9 @@ impl EGLBackedContext {
gl: &Gl,
egl_display: EGLDisplay,
) -> Result<Option<EGLBackedSurface>, Error> {
// Flush to avoid races on Mesa/Intel and possibly other GPUs.
gl.flush();

match self.framebuffer {
Framebuffer::None => return Ok(None),
Framebuffer::Surface(_) => {}
Expand Down
3 changes: 0 additions & 3 deletions src/platform/generic/egl/surface.rs
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,6 @@ impl EGLBackedSurface {
return;
}

// Flush to avoid races on Mesa/Intel and possibly other GPUs.
gl.flush();

egl.MakeCurrent(egl_display, egl::NO_SURFACE, egl::NO_SURFACE, egl_context);

match self.objects {
Expand Down

0 comments on commit 19c9ac6

Please sign in to comment.