Skip to content

egl: Add bindings for EGLImage #1713

@MarijnS95

Description

@MarijnS95

After adding a DRM example in #1691 I've on-and-off been using raw DRM as a base to allocate and present/flip GBM images (gbm_bo) by creating a gbm_surface (some sort of swapchain containing multiple gbm_bo's) that one can import into an EGLSurface (already supported in glutin), and once surface.swap_buffers() is called after rendering a new gbm_surface::lock_front_buffer() becomes available to flip to DRM (or to give to a compositor?) 1.

However, OpenGL via EGL also support rendering to individual gbm_bos, by importing them into an EGLImage via EGL_KHR_image_pixmap (iirc resummarized in EGL_KHR_image), and subsequently binding that to a new framebuffer via OES_EGL_image.

I've written some code to test this out successfully, and would like to ask before stuffing this into a PR: should we add an EGLImage representation to glutin's EGL backend (even though the code can already be written in "user code" against egl_display.raw_display() and egl_display.egl())? Furthermore, is there a similarity in other context APIs?

Note that eglCreateImage() can also be used to create EGLImages from/for various GL_TEXTURE_..., if I read it correctly.

Footnotes

  1. I'd like to submit these as extra glutin_examples at some point.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions