Skip to content

egl: preserve caller state and support surfaceless offscreen contexts - #12

Open
tritao wants to merge 2 commits into
stack/gl-foundationfrom
stack/egl-offscreen
Open

egl: preserve caller state and support surfaceless offscreen contexts#12
tritao wants to merge 2 commits into
stack/gl-foundationfrom
stack/egl-offscreen

Conversation

@tritao

@tritao tritao commented Aug 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Make Coin's offscreen EGL handling safe for applications that already own EGL state and usable in surfaceless environments.

  • Support explicit surfaceless EGL through `EGL_PLATFORM=surfaceless`.
  • Reuse an active caller display when appropriate.
  • Distinguish borrowed EGL displays from Coin-owned displays.
  • Preserve and restore the client API, display, context, draw surface, and read surface.
  • Support optional core-profile offscreen contexts through `COIN_EGL_CORE_PROFILE=1`.
  • Add focused EGL context-preservation and surfaceless runtime coverage.

The old Wayland/X11 display-probing fallback is intentionally not restored. Coin honors an explicit surfaceless request, reuses active EGL state when possible, and otherwise follows the normal EGL default-display path.

Stack

Layer 2/18, based on PR #11.

@tritao tritao changed the title stack/egl offscreen egl: support robust surfaceless offscreen contexts Aug 8, 2026
@tritao
tritao force-pushed the stack/egl-offscreen branch from 4878add to e9df85a Compare August 8, 2026 00:17
@tritao
tritao force-pushed the stack/egl-offscreen branch from e9df85a to bb6f227 Compare August 8, 2026 01:07
@tritao tritao changed the title egl: support robust surfaceless offscreen contexts egl: preserve caller state in offscreen contexts Aug 8, 2026
@tritao tritao changed the title egl: preserve caller state in offscreen contexts egl: preserve caller state and support surfaceless offscreen contexts Aug 8, 2026
@tritao
tritao force-pushed the stack/egl-offscreen branch 2 times, most recently from 9b41184 to 8047ff9 Compare August 8, 2026 01:30
@tritao
tritao marked this pull request as ready for review August 8, 2026 01:30
@tritao
tritao force-pushed the stack/egl-offscreen branch from 8047ff9 to 184b81f Compare August 8, 2026 11:06
@tritao
tritao force-pushed the stack/egl-offscreen branch from 184b81f to 397fd05 Compare August 8, 2026 11:41
@tritao
tritao force-pushed the stack/egl-offscreen branch from 397fd05 to c31eb53 Compare August 8, 2026 12:06
@tritao
tritao force-pushed the stack/egl-offscreen branch 2 times, most recently from a9bb1ec to b12d484 Compare August 8, 2026 20:31
@tritao
tritao force-pushed the stack/egl-offscreen branch 3 times, most recently from a9181d5 to 5abded1 Compare August 9, 2026 02:34
@tritao
tritao force-pushed the stack/egl-offscreen branch 3 times, most recently from bae652a to e0605fd Compare August 9, 2026 11:44
@tritao
tritao force-pushed the stack/egl-offscreen branch from e0605fd to 1da471f Compare August 9, 2026 14:55
@tritao
tritao force-pushed the stack/egl-offscreen branch from 1da471f to 40f9511 Compare August 9, 2026 15:10
@tritao
tritao force-pushed the stack/egl-offscreen branch from d0e6d2b to a7cb2be Compare August 10, 2026 11:57
@tritao
tritao force-pushed the stack/egl-offscreen branch 2 times, most recently from a9c9ce6 to ae1572b Compare August 11, 2026 14:05
@tritao
tritao force-pushed the stack/egl-offscreen branch from ae1572b to eea8241 Compare August 15, 2026 23:32
@tritao
tritao force-pushed the stack/egl-offscreen branch 2 times, most recently from 20b09b6 to 89fd72a Compare August 17, 2026 15:52
@tritao
tritao force-pushed the stack/egl-offscreen branch from 4529dd4 to 75e3407 Compare August 18, 2026 14:40
@tritao
tritao force-pushed the stack/egl-offscreen branch 2 times, most recently from 910dcff to cfb34e8 Compare August 19, 2026 01:34
Comment thread .github/workflows/continuous-integration-workflow.yml Outdated
Comment thread src/glue/gl_egl.cpp Outdated
Comment thread testsuite/EGLBindingTest.cpp Outdated
Comment thread testsuite/CMakeLists.txt Outdated
Comment thread testsuite/EGLBindingTest.cpp Outdated
Comment thread testsuite/EGLBindingTest.cpp Outdated
@tritao
tritao force-pushed the stack/egl-offscreen branch 2 times, most recently from 1bb0941 to 36d8662 Compare August 19, 2026 10:28
@tritao
tritao force-pushed the stack/egl-offscreen branch from 36d8662 to 84c1f16 Compare August 19, 2026 11:15
@tritao

tritao commented Aug 19, 2026

Copy link
Copy Markdown
Collaborator Author

Addressed the EGL review feedback:

  • Integrated coverage into the existing Ubuntu job with Mesa EGL; no separate or core-only build.

  • Scoped EGLBindingTest to Linux.

  • Removed redundant void syntax and local constants provided by eglext.h.

  • Added shared skip-code handling and coin_add_egl_test().

  • Registered the test as egl;requires-egl.

  • Split coverage into two clear cases:

    • Coin acquires and owns an explicitly requested surfaceless display.
    • Coin borrows an active caller display and restores its complete EGL binding.

@tritao
tritao force-pushed the stack/egl-offscreen branch 4 times, most recently from bb710ef to 56d7cf8 Compare August 19, 2026 11:33
@tritao
tritao force-pushed the stack/egl-offscreen branch from 56d7cf8 to 5412d16 Compare August 19, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants