Commit Graph

16 Commits (674bd3f821b8db815eda6e3be34e44be92c976a6)

Author SHA1 Message Date
Kurt Kartaltepe 674bd3f821 libobs-opengl: Use a simple 24bit framebuffer
When using EGL the mesa+nvidia stack are unable to offload 32bit
framebuffers despite having this capability on GLX. In practice the X11
server does not support alpha windows so we dont need the alpha
component in our framebuffer. We previously had alpha specified in our
framebuffer since we do alpha texturing but testing shows this isnt
required for mesa/intel or nvidia drivers and we must pick a 24bit
config for users to enable render offloading for mixed gpu systems.

fixes #6984
2022-08-30 15:28:45 -03:00
Kurt Kartaltepe 7f3ea4e00c libobs-opengl: Check window creation for errors
Without this we get somewhat misleading errors from later in the
swapchain creation when this fails. This is currently happening for
users attempting to use multi-gpu with prime offloading on nvidia.
2022-08-09 13:55:45 -03:00
Norihiro Kamae af3890a4a9 libobs: Cleanup unused-parameters
- Add OBS_UNUSED to unused function parameters
- Remove unnecessary UNUSED_PARAMETER
Also update libobs-opengl/
2022-07-19 11:01:00 -04:00
Norihiro Kamae f4854dccb4 libobs-opengl: Remove unnecessary call to retrieve screen number
The code to retrieve the screen number was originally implemented for
GLX but not necessary for EGL.
2022-06-08 08:55:03 -03:00
Norihiro Kamae 6c39b023ad libobs-opengl: Remove unused code 2022-06-08 08:55:03 -03:00
Kurt Kartaltepe d78b27961c libobs-opengl: Add create_texture_from_pixmap for EGL
create_texture_from_pixmap is only implemented for X11/EGL where it will
bind the provided X11 pixmap to a texture with glEGLImageTargetTexture2DOES
2022-05-15 09:08:53 -03:00
Kurt Kartaltepe 855572ed7c libobs-opengl: Disable vsync during present
Brings X11 EGL in line with Wayland. This prevents you from recording at
a higher fps than the monitor where an OBS preview is being displayed.
2022-04-23 00:57:42 -03:00
Richard Stanway a3c97dfad2 libobs-opengl: Miscellaneous static analysis fixes
Detected by PVS Studio.
2022-01-15 23:02:38 +00:00
columbarius b072159703 libobs-opengl: Implement DMA-BUF query functions for EGL renderer
Implement device_query_dmabuf_capabilities and
device_query_dmabuf_modifiers for EGL/Wayland and EGL/X11.
2021-12-22 14:27:53 -03:00
columbarius 4cda05f270 libobs/graphics: Add Linux-only gs_query_dmabuf_* functions
When sharing DMA-BUFs it is required the announce the underlying
hardware capabilities via supported modifiers.

Add new device_query_dmabuf_capabilities vfunc to gs_exports and connect it
to the egl implementation stubs in the supported render platforms. Add a new
public method gs_query_dmabuf_capabilities() that calls the vfunc above.

Add new device_query_dmabuf_modifiers vfunc to gs_exports and connect it
to the egl implementation in the supported render platforms. Add a new
public method gs_query_dmabuf_modifiers() that calls the vfunc above.
2021-12-22 14:27:53 -03:00
Ryan Foster 5f68991911 clang-format: Commit file changes for clang-format 12 2021-10-13 20:00:04 +11:00
Kurt Kartaltepe 705a47b0e4 libobs, libobs-opengl: add drm format param
This adds the drmbuf format as a parameter separate from the obs texture
format that will be used. drmbuf's may have a variety of formats that we
need to pass correctly to get a usable texture which may correspond to
multi-platform texture formats.
2021-03-29 17:00:31 -03:00
Georges Basile Stavracas Neto 7867d16e6b libobs-opengl: Implement DMA-BUF importing on EGL renderers
Implement device_texture_create_from_dmabuf for EGL/X11 and EGL/Wayland.
The code is shared between them, in a new gl-egl-common.c file.

This is currently limited to a few common RGB(A) formats for now, which
seems to cover most use cases.
2021-02-13 19:48:56 -03:00
Georges Basile Stavracas Neto f7a55f45fd libobs/graphics: Add Linux-only gs_texture_create_from_dmabuf()
DMA-BUF is a widespread Linux buffer sharing mechanism. It is what's
commonly used zero-copy screen sharing by Wayland compositors.

Add a new 'device_texture_create_from_dmabuf' vfunc to gs_exports,
and stub implementations to libobs-opengl. Add a new public method
gs_texture_create_from_dmabuf() that calls this vfunc.
2021-02-13 19:13:54 -03:00
Georges Basile Stavracas Neto 137966e01f libobs-opengl: Try to use the platform display if available
We need to ensure we're running all X11 code on the same display.
2021-02-09 09:39:04 -03:00
Georges Basile Stavracas Neto 2fd8a6df55 libobs-opengl: Introduce the X11/EGL winsys
Introduce the EGL/X11 winsys, and use it when the OBS_USE_EGL environment
variable is defined. This variable is only temporary, for future commits
will add a proper concept of platform.

All the EGL/X11 code is authored by Ivan Avdeev <me@w23.ru>.
2021-02-01 19:03:14 -03:00