Skip to content

Conversation

kkartaltepe
Copy link
Collaborator

@kkartaltepe kkartaltepe commented May 14, 2022

Description

Enables us to provide xcomposite capture when running on X11 on EGL and makes minor improvements to GLX implementation.

Right now its rebased on the xcomposite rewrite but that should be merged soon and ill rebase this.

Motivation and Context

Some drivers (such as nvidia) have very limited functionality for pixmap capture such as only allowing a single mapping. On popular compositors such as gnome they capture before OBS has started and so users are unable to capture windows. However these drivers dont have such a restriction when using the EGL extensions, which makes the user experience more pleasant.

How Has This Been Tested?

Tested on nvidia and intel. Everything seems to be working as expected but we have some extra code for software renders like LLVMPipe which I have not tested on the newer GLX setup or EGL.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@kkartaltepe kkartaltepe force-pushed the xcompcap-egl branch 2 times, most recently from da3ec65 to ec66b45 Compare May 14, 2022 19:53
@kkartaltepe kkartaltepe added Enhancement Improvement to existing functionality Seeking Testers Build artifacts on CI Linux Affects Linux labels May 14, 2022
@kkartaltepe
Copy link
Collaborator Author

I have this in WIP since its dependent on the rewrite but its fairly well tested and should be basically done.

@GeorgesStavracas
Copy link
Member

This needs manual rebase

@kkartaltepe kkartaltepe changed the title [wip] linux-capture: Implement EGL backend for xcomposite capture linux-capture: Implement EGL backend for xcomposite capture May 14, 2022
@kkartaltepe
Copy link
Collaborator Author

Thanks for the merge :) rebased and removed wip.

Copy link
Member

@GeorgesStavracas GeorgesStavracas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks mostly good to me, just a few nitpicks and questions

@GeorgesStavracas GeorgesStavracas mentioned this pull request May 14, 2022
6 tasks
@RytoEX RytoEX added this to the OBS Studio 28.0 milestone May 14, 2022
This updates glad for EGL and adds in several extensions.

EGL_EXT_platform_base
EGL_EXT_platform_xcb
EGL_KHR_image_base
EGL_KHR_image_pixmap

The xcb platform extension is unused but good to include if we want to
try removing more Xlib dependencies. platform_base is included for good
measure as other platform extensions technically build on it. image_base
and image_pixmap are for upcoming xcomposite over EGL support.

It also drops the unused create_context_no_error extensions.
create_texture_from_pixmap is only implemented for X11/EGL where it will
bind the provided X11 pixmap to a texture with glEGLImageTargetTexture2DOES
When running on EGL we can use the new create_texture_from_pixmap
functions to implement xcomposite capture.

This removes the texture indirection previously implemented for GLX due
to not using the spriting functionality in the built in shaders. Now
that we texture directly from the pixmap we can remove the red/blue swap
workarounds.
Copy link
Member

@GeorgesStavracas GeorgesStavracas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Improvement to existing functionality Linux Affects Linux Seeking Testers Build artifacts on CI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants