Commit Graph

148 Commits

Author SHA1 Message Date
Geoffrey McRae
edc9825c04 [client] egl: check for invalid desktop render dimensions 2021-10-20 11:17:29 +11:00
Quantum
8dcf7af791 [client] egl: fix parentheses in IDX_AGO definition
The old definition could break if complex expressions were passed in
as arguments.
2021-10-17 06:10:30 +11:00
Quantum
2d858da0f1 [client] egl: fix egl_bufferAge naming 2021-10-17 06:10:30 +11:00
Quantum
ee211803e4 [client] egl: fix letterbox rendering
Add additional half pixel in all directions to ensure erasure of
content in the letterbox area under all circumstances.
2021-10-17 06:10:30 +11:00
Quantum
148ab0278e [client] egl: add debug options to disable damage tracking
This should aid in figuring out the source of damage tracking bugs.
2021-10-14 17:01:48 +11:00
Quantum
072c54977e [client] egl: use eglCreateImage and eglDestroyImage indirectly
The dmabuf path is optional, so we shouldn't require those functions to
link our program.
2021-09-29 17:48:50 +10:00
Quantum
ac926e4458 [client] egl: support debug contexts on older EGL versions 2021-09-04 13:24:45 +10:00
Quantum
9aa0d3ddab [client] egl: fix context creation on EGL 1.4
EGL_CONTEXT_OPENGL_DEBUG is only defined in EGL 1.5, and therefore, we should
not be passing it on older versions of EGL.
2021-08-19 21:28:56 +10:00
Quantum
b7d3bbbd82 [client] egl: use standard-compliant way of EGL detection
According to the documentation for eglQueryString:

> EGL_BAD_DISPLAY is generated if display is not an EGL display connection,
> unless display is EGL_NO_DISPLAY and name is EGL_EXTENSIONS.

Therefore, we should check EGL by doing:

    eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS)

Indeed, the old way of eglQueryString(EGL_NO_DISPLAY, EGL_VERSION) works on
libglvnd but not using mesa's libEGL.so directly.

Also added a warning to make it more obvious that EGL is not available.
2021-08-16 16:25:48 +10:00
Quantum
5f3bd778c0 [client] egl: add debug prints for renderStartup errors 2021-08-14 12:20:12 +10:00
Quantum
16adbab5d4 [client] all: remove needless initalization 2021-08-14 12:19:07 +10:00
Quantum
85a96d1e06 [client] all: use DEBUG_UNREACHABLE instead of assert
Due to the way assert is defined in standard C, compilers in release mode
will not treat it as unreachable. This explains a lot about those pesky
uninitialized variable bugs, actually.
2021-08-14 12:19:07 +10:00
Geoffrey McRae
6387bf2d2e [client] rework the configuration overlay to allow for tabs 2021-08-12 09:04:45 +10:00
Quantum
7e982a6658 [client] util: replace util_mergeOverlappingRects with common version 2021-08-11 19:01:52 +10:00
Geoffrey McRae
f0ea882165 [client] egl: cleanup texture filtering/post-processing 2021-08-11 18:53:36 +10:00
Quantum
cd5ecf3e5a [client] egl: don't erase damage when invalidating whole window 2021-08-11 02:43:08 +10:00
Geoffrey McRae
c3a143732c [client] egl: cosmetics 2021-08-10 13:46:48 +10:00
Geoffrey McRae
dc0b3a8d45 [client] egl: rework post process filters and add AMD FXR 2021-08-10 13:46:48 +10:00
Geoffrey McRae
cc3494437a [client] egl: add ffx cas configuration options 2021-08-10 01:10:08 +10:00
Geoffrey McRae
86d6b67337 [client] egl: rework egl to accomodate post-processing filtering 2021-08-09 14:08:10 +10:00
Geoffrey McRae
266ad27998 [client] egl: refactor to use project naming standard 2021-08-08 17:16:10 +10:00
Geoffrey McRae
30ed563504 [client] interface: refactor to use camlCase function names 2021-08-08 15:43:42 +10:00
Geoffrey McRae
f8ae291090 [client] interface: switch to using UPCAST for the renderer's data 2021-08-08 15:32:01 +10:00
Geoffrey McRae
45d1f27fb4 [client] interface: rename LG_Renderer to LG_RendererOps
Part of the standardisation of using the `Ops` suffix for all interfaces
2021-08-08 14:43:04 +10:00
Quantum
b822e255d8 [client] egl: attempt DMABUF import and fallback if it fails
This should deal with drivers not supporting our DMABUF without attempting
to identify the drivers and blacklist them.
2021-08-08 09:53:47 +10:00
Quantum
ac3677d9ae [client] egl: implement partial copies for framebuffer textures
This uses the same line sweep algorithm originally created to copy DXGI
textures to IVSHMEM to implement the copy from IVSHMEM to memory-mapped
pixel buffer objects.
2021-08-08 08:30:11 +10:00
Geoffrey McRae
e755f0befa [client] egl: correct letterbox area clear attempt #3 - sigh 2021-08-07 04:00:18 +10:00
Geoffrey McRae
9f6ad864ed [client] egl: correct letterbox area clear attempt #2 :) 2021-08-07 03:44:47 +10:00
Geoffrey McRae
e5a138d854 [client] egl: properly clear the letterbox areas 2021-08-07 03:28:52 +10:00
Geoffrey McRae
162b1b93db [client] main: don't include the swap into the render timings
If vsync is enabled the swap will block until vblank skewing the timing
metrics.
2021-08-07 01:45:42 +10:00
Quantum
5d3c00717a [client] egl/imgui: use imgui for scaling algorithm selection 2021-08-06 22:49:49 +10:00
Quantum
dc7fd74327 [client] egl: refactor config dialog into main egl module
This will allow other things like scaling to be implemented.
2021-08-06 22:49:49 +10:00
Quantum
65e550a61c [client] egl: pad buffer damage by 1px when rendering desktop
We want to add extra padding to deal with scaling, which may end up blending
with neighbouring pixels.
2021-08-05 08:05:30 +10:00
Quantum
51b9cd4e5a [all] copyright: use unicode copyright sign ©
This is done for consistency with the license strings in appstrings.c.
2021-08-04 21:16:35 +10:00
Geoffrey McRae
f7682c289a [client] egl: always render the black bar areas
Failure to render these causes artifacts/ghosting when the overlays are
using this area, as such we need to always render this area of the
screen.
2021-08-03 22:29:04 +10:00
Geoffrey McRae
4b4a75475a [client] egl: fix out by one error with letterbox rendering
This replaces the scaled `destRect` with a version that uses doubles
correcting the rounding error that is causing a failure to properly
clear the black bar areas.
2021-08-03 22:27:46 +10:00
Quantum
8545d15c85 [client] egl: warn when EGL_EXT_buffer_age is not supported 2021-08-03 21:37:31 +10:00
Quantum
87aac8cf03 [client] egl: use buffer age extension to render only damaged parts
We avoid rendering any area that has not changed since the buffer was used
and also not covered by an overlay.
2021-08-03 21:37:31 +10:00
Quantum
f9977332a6 [client] egl: convert desktop to use desktop_rects 2021-08-03 21:37:31 +10:00
Quantum
2dca056526 [client] egl: refactor damage mesh generation into desktop_rects
This mesh will later be used to render only damaged portions of the desktop.
We also moved the coordinate transformation for damage overlay into a matrix
and computed by the shader.
2021-08-03 21:37:31 +10:00
Geoffrey McRae
f3413815a9 [client] egl: re-implement DMABUF (untested) 2021-08-03 03:59:03 +10:00
Quantum
5d5e4ede1a [client] egl: use new EGL damage count semantics
After the damage queue PR, EGL damage count 0 means no change, and -1 means
invalidate the entire window. However, several other places have different
semantics, and we are not handling them correctly:

1. KVMFR uses 0 to signal invalidating the entire frame, so if we receive 0
   rectangles in egl_on_frame, we should set damage count to -1.
2. The damage overlay treated 0 as full damage, which is now incorrect. This
   is fixed, and now it treats 0 as no update, and -1 as full damage.
2021-08-03 00:57:32 +10:00
Geoffrey McRae
13d9c84dc9 [client] egl: replace monolithic EGLTexture with modular version
The way things were handled in EGLTexture is not only very hard to
follow, but broken. This change set breaks up EGLTexture into a modular
design making it easier to implement the various versions.

Note that DMABUF is currently broken and needs to be re-implemented.
2021-08-02 23:37:33 +10:00
Quantum
23c77e8508 [client] egl: use a lock for desktop damage to eliminate all races
There used to be a possible race when a bunch of rectangle is appended, but
the total count is not updated before it's read. Using a lock eliminates
all such races.
2021-08-01 19:54:56 +10:00
Geoffrey McRae
f8e1ab8f31 [client] renderers: add new needs_render method to the interface
With jitRender the renderer needs to tell the main application if it
needs to be rendererd, such as during the initial splash screen fade
out.
2021-08-01 18:18:08 +10:00
Quantum
b3b71d6f02 [client] egl: fix cursor handling when invalidating
If we invalidate the window, we used to not update this->cursorLast, and
this causes us to lose track of the cursor. Now we update this->cursorLast
unconditionally, and this fixes the issue.
2021-08-01 17:28:40 +10:00
Quantum
b9a7ce17fe [client] egl: use queue of damages
This prevents damage from being overwritten when frames are received
faster than could be rendered.

This implementation cycles between two queues, removing all need for
memory allocation.
2021-08-01 12:11:54 +10:00
Quantum
a980cd9406 [client] egl: log when EGL_EXT_image_dma_buf_import is unavailable 2021-07-29 17:03:44 +10:00
Quantum
6c64965703 [client] egl: make functions that do not need linking static 2021-07-29 16:54:56 +10:00
Quantum
134829cbf2 [client] imgui: make graph y-axis configurable
The default of [0, 50] makes sense for FPS/UPS graphs, but does not for
things like the import graph. The latter should not take more than 5 ms
for sure.

This commit allows the min/max y-axis value to be specified when registering
the graph.
2021-07-29 15:54:15 +10:00