Commit Graph

577 Commits

Author SHA1 Message Date
Geoffrey McRae
8974ae4fb5 [client] add SVG loading support and use icons for status display
This brings nanosvg into the project for SVG loading and rendering.
Unfortunatly we can not at this time use a submodule for this project
until https://github.com/memononen/nanosvg/pull/214 is merged.
2022-05-26 04:11:31 +10:00
Geoffrey McRae
8aa36144dc overlay: move init/free to the context of the render thread
This is done to allow overlays to make use of the renderer during
init/free.
2022-05-26 00:46:13 +10:00
Geoffrey McRae
6cbfa6e734 [client] egl: add spice display support 2022-05-24 06:57:33 +10:00
Geoffrey McRae
faae785c44 [client] spice: initialize new surfaces to black 2022-05-24 00:17:08 +10:00
Geoffrey McRae
b5dfbcb5a2 [client] egl: added missing case from texture init 2022-05-23 20:55:02 +10:00
Geoffrey McRae
247e867f18 [client] egl: implemented SPICE display support 2022-05-22 18:19:58 +10:00
Geoffrey McRae
6699018ed1 [client] egl: check for null before free 2022-05-22 12:05:02 +10:00
Geoffrey McRae
947db38bc9 [client] egl: fix mistake in rect clamping 2022-05-22 11:53:46 +10:00
Geoffrey McRae
1fcdcc8725 [client] egl: allow for partial texture updates 2022-05-21 21:21:16 +10:00
Geoffrey McRae
2901e7aec5 [client] egl: only upload the damage rects if they actually changed
Profiling shows that a considerable amount of time is spent in
glBindBuffer and glBufferSubData when the damage rects are updated.
Since the amount of data here is quite small it's far faster to check if
it's different then to just blindly overwrite the buffer on each call.

Profiled on an Intel CPU with UHD P630 Graphics using magic-trace
2022-05-17 00:51:13 +10:00
Geoffrey McRae
6afd262a27 [client] egl: update AMD FSR to 1.0.2 2022-05-04 15:29:21 +10:00
Geoffrey McRae
eae559b4c9 [client/obs] update to support downscaled frames coming from the host 2022-05-01 19:51:25 +10:00
Geoffrey McRae
3a8cb6a613 [client/common] fixes for issues detected through static analysis. 2022-03-07 10:14:52 +11:00
Paul Hollinsky
3890c72159 [client] egl: use texture sampler for desktop
The desktop doesn't need its own sampler, there is already an identically
configured one in the `desktop->texture`.

For some reason, using the texture sampler fixes a black screen issue
with my GTX 660 using the 470.86 driver. Maybe hitting some limit
for how many samplers can be allocated?
2022-02-08 15:34:54 +11:00
Paul Hollinsky
4223a5e38f [client] egl: remove extra sampler from TextureBuffer
It was unused, there is a sampler in EGL_Texture (base).
2022-02-08 15:34:54 +11:00
Geoffrey McRae
b0568ca404 [client] egl: use a sigmoid curve for nv 2022-01-26 23:03:35 +11:00
Geoffrey McRae
fb4bdaee2b [client] egl: set the active preset if specified at launch 2022-01-26 16:07:17 +11:00
Geoffrey McRae
c7389285f9 [client] egl: fix null pointer access when no preset is set 2022-01-26 16:04:15 +11:00
Geoffrey McRae
aa426d13a7 [client] egl: added egl:preset to load a default preset at startup 2022-01-26 16:00:07 +11:00
Geoffrey McRae
89c83dafc1 [client] egl: make egl less noisy unless debug is specified 2022-01-26 15:42:33 +11:00
Geoffrey McRae
22f3cf5ba6 [client] egl: fix masked color cursor blend operation for xor drawing 2022-01-26 12:23:05 +11:00
Geoffrey McRae
3067bdaa15 [client] egl: properly apply xor mask to masked color cursors 2022-01-26 12:11:43 +11:00
Geoffrey McRae
96fa8891c8 [client] egl: fixed incorrect drawing of masked color cursors 2022-01-24 06:56:32 +11:00
Geoffrey McRae
1082875b8e [client] opengl: fix startup since ImGui upgrade 2022-01-24 06:42:16 +11:00
Quantum
9a6aa3ce66 [client] egl: remove duplicate #include "app.h" 2022-01-23 08:49:15 +11:00
Quantum
f2fbb2b27c [client] opengl: make draw functions static 2022-01-23 08:49:01 +11:00
Geoffrey McRae
464fee3e20 [client] overlay/graphs: allow the graph to have a custom title format 2022-01-17 22:08:56 +11:00
Chris Spencer
f635077a2c [client] egl: increase texture processing timeout
On my machine (Intel UHD Graphics 770), texture processing occasionally
(about 5% of the time) takes more than 20ms (the highest I have seen is
around 32ms) when the host resolution is 2560x1440. This results in the
frame being discarded and the client displays a stale image. Increase the
timeout to 40ms.
2022-01-14 12:31:02 +11:00
Geoffrey McRae
6bba9bc25d [client/common] move ll from the client into the common code module 2022-01-12 12:22:18 +11:00
Geoffrey McRae
1851002fc1 [client] all: remove ll_walk and migrate over to ll_forEachNL 2022-01-12 12:17:29 +11:00
Geoffrey McRae
ec0bd6adc8 [client] imgui: update to cimgui 1.86 2022-01-08 00:26:12 +11:00
Geoffrey McRae
952ebea2c5 [all] refresh copyright dates 2022-01-05 19:42:46 +11:00
Geoffrey McRae
d708651c53 [client] egl: check for null gl strings 2022-01-05 12:38:38 +11:00
Geoffrey McRae
35efa551ef [client] egl: determine mouse scale using both horiz and vert size 2021-12-28 19:04:24 +11:00
Quantum
136737f25b [client] egl: simplify EGL torus code 2021-12-28 10:19:36 +11:00
Geoffrey McRae
d69069fb09 [client] egl: keep the mouse cursor 1:1 when downscaling
This keeps the cursor a usable size when the guest is running a high
resolution and downscaling (ie, 4K -> FHD).
2021-12-26 11:08:42 +11:00
Geoffrey McRae
adbe333414 [client] egl: dmabuf can be used without GL_EXT_buffer_storage support 2021-12-15 06:10:30 +11:00
Quantum
15066c7345 [client] egl: handle eglQuerySurface(EGL_BUFFER_AGE_EXT) error 2021-12-14 14:35:30 +11:00
Quantum
58f83da7bb [client] egl: increase the damage box for the cursor 2021-12-02 22:07:37 +11:00
Quantum
3e9a21d3b9 [client] egl: use linear filter when not scaling
This appears to eliminate artifacts related to non-full screen paints
due to precision errors with the nearest filter.
2021-12-02 22:07:24 +11:00
Geoffrey McRae
8167ef2c4a [client] egl: make use of glsl's textureSize function 2021-11-12 07:41:59 +11:00
Geoffrey McRae
67ea8e06ba [client] egl: use alloca instead of typecasted char array 2021-10-24 22:57:21 +11:00
Quantum
ad6e3f96e6 [client] egl: reset damage on renderer restart 2021-10-23 18:38:21 +11:00
Geoffrey McRae
fe712b7ec9 [client] egl: damage the full screen if the frame format changes 2021-10-22 18:51:49 +11:00
Geoffrey McRae
dca5da02a0 [client] egl: fix undefined behaviour with zero size array 2021-10-20 13:34:16 +11:00
Quantum
2858ad3f7e [client] egl: fallback when EGL_RENDER_BUFFER fails
This allows the client to work when the OpenGL implementation fails if
EGL_RENDER_BUFFER is passed, printing a warning. This should fix issues
with Nvidia proprietary drivers on Wayland.
2021-10-20 11:31:00 +11:00
Quantum
9ddd260b22 [client] egl: log glCheckFramebufferStatus error 2021-10-20 11:30:40 +11:00
Geoffrey McRae
bc34dc9e24 [client] egl: blame NVIDIA if dmabuf fails on NVIDIA hardware
NVIDIA still do not implement a complete/working DMABUF implementation
yet advertise support. Best to tell the public to complain to NVIDIA
instead of assuming it's a LG bug or an issue with their system.
2021-10-20 11:28:29 +11:00
Geoffrey McRae
edc9825c04 [client] egl: check for invalid desktop render dimensions 2021-10-20 11:17:29 +11:00
Geoffrey McRae
70a751b58d [client] egl/filters: bypass setup/prepare logic if disabled/inactive
filters are now not run if `egl_filterSetup` returns false, as such we
do not need additional `enable` checks in `prepare` or `run` and we can
bypass the filters even earlier if they are not enabled reducing load.
2021-10-20 10:57:53 +11:00
Quantum
fc037ccc95 [client] egl: handle filter setup returning false
As discussed, this should just skip the filter as if it's disabled.
2021-10-20 10:48:18 +11:00
Quantum
74418106de [client] egl: skip downscale filter setup when not enabled
Since this->prepared will never be set to true unless the filter is
enabled, this results in the framebuffer setup being done every frame
for no reason, causing a lot of texture reallocations.
2021-10-20 10:47:59 +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
d60dcb718b [client] cmake: correctly detect non-gawk awks
Forgetting NAMES meant that cmake was searching for gawk only.
2021-10-14 17:01:37 +11:00
Quantum
6370350006 [client] opengl: indirectly access non-OpenGL 1.3 functions
This commit adds check for the extensions that we need and then calls
the functions indirectly through gl_dynprocs.

This should improve compatibility with older versions of OpenGL, as we
now fallback to the ARB extensions if possible, and in the case of
glGenerateMipmap, we can handle the function not existing at all.
2021-10-01 01:45:11 +10:00
Quantum
3f72de78da [client] opengl: use util_hasGLExt instead of custom logic 2021-10-01 01:45:11 +10:00
Quantum
4a76401c34 [client] egl: make the last eglDestroyImage call indirect
Missed this one in the last PR.
2021-09-29 18:28:07 +10: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
1b58f2592c [client] egl: make filters damage aware
This saves a lot of GPU power for partial updates. Running testufo with
lanczos downscaling and FSR upscaling consumed over 90 W, but with this
commit, consumed only 75 W.
2021-09-04 13:30:24 +10:00
Quantum
e9bf225c75 [client] egl: remove useless RenderStep struct 2021-09-04 13:28:49 +10:00
Quantum
ac926e4458 [client] egl: support debug contexts on older EGL versions 2021-09-04 13:24:45 +10:00
Quantum
26d2feb4d8 [client] egl: remove warning disabling in ffx.c 2021-09-04 13:24:34 +10:00
Quantum
977a4f6323 [client] egl: remove useless comment in filter_downscale.c 2021-08-31 20:14:39 +10:00
Quantum
f4df690d9f [client] egl: fix preset tooltip always showing 2021-08-30 18:47:48 +10:00
Quantum
239cb6a92b [client] egl: add separator after presets 2021-08-30 18:45:21 +10:00
Quantum
876a4125bf [client] egl: correctly select the preset when saving over it 2021-08-30 18:45:21 +10:00
Quantum
ffbf6cd8b4 [client] egl: make preset UI more intuitive
This commit makes selecting a preset load it, and changes "Create preset" to
"Save preset as...".
2021-08-30 18:45:21 +10:00
Quantum
39e42ba735 [common] option: change option_dump to option_dump_preset
This new function dumps all options marked as preset instead of dumping
individual sections. This should allow filter options to not be all grouped
into the [eglFilter] section.
2021-08-30 18:32:16 +10:00
Quantum
3345ff8448 [client] egl: mark all preset-only options as such 2021-08-30 18:21:54 +10:00
Quantum
8a2ae6860e [client] egl: warn when attempting to save without preset selected 2021-08-30 18:21:54 +10:00
Quantum
1717555187 [client] egl: implement preset deletion 2021-08-30 18:21:54 +10:00
Quantum
dc27638025 [client] egl: implement loading and saving of filter order 2021-08-30 18:21:54 +10:00
Quantum
c85cc7d668 [client] egl: show preset errors as modal dialogs 2021-08-30 18:21:54 +10:00
Quantum
311f7241c6 [client] egl: implement preset loading/saving logic 2021-08-30 18:21:54 +10:00
Quantum
b7b93f624c [client] egl: implement options loading/saving for downscale 2021-08-30 18:21:54 +10:00
Quantum
084837b936 [client] egl: add loadState and saveState for filters 2021-08-30 18:21:54 +10:00
Quantum
4adb425337 [client] egl: add UI for presets list 2021-08-30 18:21:54 +10:00
Quantum
5225d2e97f [client] egl: fix framebuffer leaking textures 2021-08-28 19:17:24 +10:00
Quantum
e6df0acad9 [common] vector: eliminate double allocation when possible
This commit creates two constructor/destructor pairs for vector:
* vector_alloc/vector_free dynamically allocates the vector itself
* vector_create/vector_destroy uses existing Vector objects
2021-08-28 19:17:15 +10:00
Quantum
ceff9dca9b [client] egl: simplify filter moving logic with memmove
This avoids duplicating the entire array of filters.
2021-08-25 05:35:50 +10:00
Quantum
7c7eff8dba [client] egl: make texture_dmabuf.c use vector
This replaces the custom memory management code.
2021-08-24 22:10:36 +10:00
Geoffrey McRae
b118c3b681 [client] egl: implement nicer drag & drop re-ordering of filters 2021-08-24 22:05:46 +10:00
Quantum
e5e76d784e [client] egl: allow postprocessing filters to be reordered by dragging 2021-08-22 21:36:13 +10:00
Quantum
99761b195f [client] egl: switch postprocessing filters to use vectors
This will allow them to be reordered much more easily.
2021-08-22 21:36:13 +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
429620c48b [client] egl: dynamically import glBufferStorageEXT
On some implementations (e.g. llvmpipe), the function can only be queried via
eglGetProcAddress.
2021-08-19 21:28:45 +10:00
Quantum
bb91b41c64 [client] egl: look at 3x3 around the pixel instead of 4x4
Using 4x4 means that some pixels will be outside of the lanczos window. The
ideal lanczos function should in fact be zero in those areas, so we shouldn't
waste time processing those pixels.

I can't notice any difference in the results.
2021-08-19 15:52:44 +10:00
Quantum
520460669c [client] egl: set gl_Position.z in cursor vertex shader 2021-08-19 12:24:55 +10:00
Quantum
81c38e825c [client] remove all casts around malloc
The cast is unnecessary in C and should be removed to avoid clutter.
2021-08-16 16:26:58 +10:00
Quantum
fd4a4114e6 [client] egl: pad areas of the desktop repainted to cover overlays
We pad the screen coordinates and then convert to desktop coordinates,
so that the padding will always be a pixel wide on screen.
2021-08-16 16:26:18 +10:00
Quantum
104141eec1 [client] use correct argument order for calloc 2021-08-16 16:25:59 +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
Tudor Brindus
14ad83c6b8 [client] use variable-relative sizeof where possible 2021-08-16 16:22:55 +10:00
Quantum
8f5afe1848 [client] egl: clamp sharpness settings in filters
While the slider does not allow you to get out of range by dragging,
the user could still type in out of range values, so we clamp the values.
2021-08-15 18:01:03 +10:00
Quantum
36073586e7 [client] egl: add tooltip about Ctrl+Click on sharpness sliders
With the new keymap feature, we are now able to properly support letting
the user enter exact values into the sliders. This commit adds a tooltip
to help the user discover this feature.

Note that this currently only works on Wayland. The X11 backend will need
to call app_handleKeyboardModifiers.
2021-08-15 18:01:03 +10:00
Quantum
bbd173000f [client] egl: clamp downscale factor range 2021-08-14 14:57:33 +10:00
Quantum
96738ab9d0 [client] egl: make downscale filter use text input widget
The major/minor pixel size hack is too confusing. This commit replaces
that with a text input and a slider.
2021-08-14 14:44:26 +10:00