mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
app/internal/window: finish GL commands before surface detruction
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+13
-12
@@ -71,11 +71,7 @@ func (c *context) Release() {
|
|||||||
c.srgbFBO.Release()
|
c.srgbFBO.Release()
|
||||||
c.srgbFBO = nil
|
c.srgbFBO = nil
|
||||||
}
|
}
|
||||||
if c.eglSurf != nilEGLSurface {
|
c.destroySurface()
|
||||||
eglMakeCurrent(c.eglCtx.disp, nilEGLSurface, nilEGLSurface, nilEGLContext)
|
|
||||||
eglDestroySurface(c.eglCtx.disp, c.eglSurf)
|
|
||||||
c.eglSurf = nilEGLSurface
|
|
||||||
}
|
|
||||||
c.eglWin = nilEGLNativeWindowType
|
c.eglWin = nilEGLNativeWindowType
|
||||||
if c.eglCtx != nil {
|
if c.eglCtx != nil {
|
||||||
eglDestroyContext(c.eglCtx.disp, c.eglCtx.ctx)
|
eglDestroyContext(c.eglCtx.disp, c.eglCtx.ctx)
|
||||||
@@ -126,6 +122,17 @@ func (c *context) Lock() {}
|
|||||||
|
|
||||||
func (c *context) Unlock() {}
|
func (c *context) Unlock() {}
|
||||||
|
|
||||||
|
func (c *context) destroySurface() {
|
||||||
|
if c.eglSurf == nilEGLSurface {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
// Make sure any in-flight GL commands are complete.
|
||||||
|
c.c.Finish()
|
||||||
|
eglMakeCurrent(c.eglCtx.disp, nilEGLSurface, nilEGLSurface, nilEGLContext)
|
||||||
|
eglDestroySurface(c.eglCtx.disp, c.eglSurf)
|
||||||
|
c.eglSurf = nilEGLSurface
|
||||||
|
}
|
||||||
|
|
||||||
func (c *context) MakeCurrent() error {
|
func (c *context) MakeCurrent() error {
|
||||||
win, width, height, err := c.driver.eglWindow(int(c.eglCtx.visualID))
|
win, width, height, err := c.driver.eglWindow(int(c.eglCtx.visualID))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
@@ -141,13 +148,7 @@ func (c *context) MakeCurrent() error {
|
|||||||
c.srgbFBO.Release()
|
c.srgbFBO.Release()
|
||||||
c.srgbFBO = nil
|
c.srgbFBO = nil
|
||||||
}
|
}
|
||||||
if c.eglSurf != nilEGLSurface {
|
c.destroySurface()
|
||||||
// Make sure any in-flight GL commands are complete.
|
|
||||||
c.c.Finish()
|
|
||||||
eglMakeCurrent(c.eglCtx.disp, nilEGLSurface, nilEGLSurface, nilEGLContext)
|
|
||||||
eglDestroySurface(c.eglCtx.disp, c.eglSurf)
|
|
||||||
c.eglSurf = nilEGLSurface
|
|
||||||
}
|
|
||||||
c.eglWin = win
|
c.eglWin = win
|
||||||
if c.eglWin == nilEGLNativeWindowType {
|
if c.eglWin == nilEGLNativeWindowType {
|
||||||
return nil
|
return nil
|
||||||
|
|||||||
Reference in New Issue
Block a user