Commit Graph

75 Commits

Author SHA1 Message Date
Geoffrey McRae
64ed383128 [client] egl: re-process the texture and invalidate if a setting changed 2021-08-10 07:51:23 +10:00
Quantum
eb680086ef [client] egl: correctly use flexible array members for BindData
Array size of 0 is a gcc extension, the standard C is not declaring a size.
2021-08-10 06:10:42 +10:00
Geoffrey McRae
92de467edc [client] egl: add ffx_cas post process filter 2021-08-09 23:12:58 +10:00
Geoffrey McRae
4eda01949d [client] egl: give pp filters the dimensions of all prior textures 2021-08-09 22:02:07 +10:00
Geoffrey McRae
062d18d5fa [client] egl: don't allocate the texture ringbuffer unless needed 2021-08-09 18:28:52 +10:00
Geoffrey McRae
04a54598b3 [client] egl: set a default scale for textures without filters 2021-08-09 18:27:10 +10:00
Geoffrey McRae
79dcc6d4f1 Revert "[client] egl: set a default scale for textures without filters"
This reverts commit 57a74c156b.
Pushed a ton of changes that should not have been pushed
2021-08-09 18:26:30 +10:00
Geoffrey McRae
57a74c156b [client] egl: set a default scale for textures without filters 2021-08-09 18:24:33 +10:00
Geoffrey McRae
6882e5c59f [client] egl: provide the texture scale to the desktop shader
If the texture has a post-processing filter that has scaled the texture,
the desktop fragment shader needs to know this if it's doing linear
scaling.
2021-08-09 18:22:28 +10:00
Geoffrey McRae
f7f8060447 [client] egl: allow setting an output scale for a post-process shader 2021-08-09 17:57:36 +10:00
Geoffrey McRae
86d6b67337 [client] egl: rework egl to accomodate post-processing filtering 2021-08-09 14:08:10 +10:00
Geoffrey McRae
91d1b8d2cd [client] egl: refactor egl_texture_free to use project naming standards 2021-08-08 17:52:13 +10:00
Geoffrey McRae
baf9661530 [client] egl: remove texture->ops indirection 2021-08-08 17:31:52 +10:00
Geoffrey McRae
266ad27998 [client] egl: refactor to use project naming standard 2021-08-08 17:16:10 +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
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
f3413815a9 [client] egl: re-implement DMABUF (untested) 2021-08-03 03:59:03 +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
b8effaf42c [client] egl: use glGetError and codes for errors in gl* functions
We used to use DEBUG_EGL_ERROR for gl* functions, which just yields
EGL_SUCCESS even when there are errors.
2021-07-19 19:36:46 +10:00
Quantum
7c872d2d9e [client] egl: properly use OpenGL ES
Instead of using the desktop <GL/gl.h>, we properly use the OpenGL ES 3.x
headers. Also, we now use GL_EXT_buffer_storage for MAP_PERSISTENT_BIT_EXT
and MAP_COHERENT_BIT_EXT as the core versions are only available in desktop
OpenGL 4.4. Similarly, we need GL_EXT_texture_format_BGRA8888 for GL_BGRA_EXT
as GL_BGRA is desktop-only.
2021-07-18 20:44:32 +10:00
Quantum
c6a6230a56 [client] egl: revert "only copy damaged areas when using dmabuf"
This reverts commit a14de25661.
Frame is sometimes incorrect.
2021-07-18 18:48:35 +10:00
Quantum
a14de25661 [client] egl: only copy damaged areas when using dmabuf
This speeds up the copy significantly when the frame only has small
amount of damage.
2021-07-18 17:41:29 +10:00
Quantum
eb357fa58a [client] egl: use glCopyTexSubImage2D to copy when using DMA
This removes the need for the driver to allocate texture storage and deleting
the previous allocation on every frame update.
2021-07-18 10:34:21 +10:00
Geoffrey McRae
f07e4839b1 [client] egl: fix dmabuf support 2021-06-08 20:51:09 +10:00
Geoffrey McRae
964403b4f8 [client] egl: tex is now an array, so check it properly for assignment 2021-06-08 20:45:37 +10:00
Geoffrey McRae
20d20f5c8a [client] egl: fix incorrect texture usage
The existing code would overwrite the texture's data even if the texture
is currently being used to render to screen. This changeset generates a
texture for each buffer preventing this invalid usage.
2021-06-08 20:41:22 +10:00
Quantum
24d0aa0c18 [all] normalize copyright on all source files 2021-06-06 11:53:05 +10:00
eater
62725bcb9d [client] egl: show error for glMapBufferRange instead of glBindbuffer 2021-05-04 10:30:03 +10:00
vroad
5d5eb47598 [client] egl: do not leak fence when using DMABUF 2021-04-25 14:32:17 +10:00
Quantum
63ec2dc01b [client] egl: destroy cached EGLImages when changing format
Reusing cached EGLImages while the frame format has changed will result
in visual artifacts. We should instead destroy the EGLImages and let
them be recreated.
2021-02-21 19:07:46 +11:00
Quantum
39a09ca565 [client] egl: remove dependency on SDL
After this PR, EGL functions are now accessed through <EGL/egl.h>
instead of through <SDL2/SDL_egl.h>, removing a pointless dependency
on SDL.
2021-02-21 10:31:49 +11:00
Quantum
30a888711b [client] egl: force DMA copy into texture in on_frame
This commit forces the DMA'd memory to be copied into the texture in
the EGL on_frame handler. This avoids tearing when the LG host inevitably
updates the underlying memory. We need an additional copy inside the GPU,
but this is cheap compared to copying from system memory.

We could have used logic to lock the memory buffer, but that would require
performing DMA on every frame, which wastes memory bandwidth. This
manifests as reduced frame rate when moving the mouse compared to the
non-DMA implementation.

We also keep multiple EGLImages, one for each DMA fd, to avoid issues
with the OpenGL driver.
2021-02-21 10:31:48 +11:00
Geoffrey McRae
ca5c3938e4 [client] all: move all SDL specific code into displayservers/sdl 2021-02-21 10:31:48 +11:00
Geoffrey McRae
bf583290a4 [client/common] restructure project in prep for full SDL removal 2021-02-21 10:31:46 +11:00
Geoffrey McRae
202739c5be [client] egl: better debug output for EGL errors 2021-01-24 13:17:11 +11:00
Geoffrey McRae
9941a4bb83 [client] egl: runtime detect support for glEGLImageTargetTexture2DOES 2021-01-24 12:06:10 +11:00
Geoffrey McRae
2738e822a4 [client] egl: remove external dependency on libdrm 2021-01-16 22:11:15 +11:00
Tudor Brindus
a46a3a2668 [all] use explicit void parameter lists
This makes it a compile-time error to call a function that semantically
takes no parameters with a nonzero number of arguments.

Previously, such code would still compile, but risk blowing up the stack
if a compiler chose to use something other than caller-cleanup calling
conventions.
2021-01-14 17:29:37 +11:00
Geoffrey McRae
4334912e01 [client] egl: actually set the dma texture member 2021-01-09 22:16:40 +11:00
Geoffrey McRae
bf1eba15d1 [client] egl: actually do front buffer rendering 2020-12-31 15:31:24 +11:00
Geoffrey McRae
1e4e582f67 [client] egl: only use a single texture but multiple PBOs 2020-12-31 14:18:38 +11:00
Geoffrey McRae
678ba0f484 [client] egl: check for EGLImage creation failure 2020-12-31 12:58:40 +11:00
Geoffrey McRae
2c2008c981 [client] egl: improve DMA logic 2020-12-31 12:58:22 +11:00
Geoffrey McRae
4c14797319 [client] egl: no need to create textures when using DMA mode 2020-10-30 22:19:15 +11:00
Geoffrey McRae
42fef7a98d [client] egl: remove deprecated YUV420 support 2020-10-30 19:31:48 +11:00
Geoffrey McRae
267fa6e389 [client] egl: select the correct fourcc type for dma mode 2020-10-30 11:55:47 +11:00
Geoffrey McRae
4f9544d61d [client] egl: added DMA texture support for direct upload
Note: This only works with the KVMFR kernel module in a VM->VM
configuration. If this causes issues it can be disabled with the new
option `app:allowDMA`
2020-10-30 02:36:45 +11:00
Geoffrey McRae
919b77df71 [client] egl: fix RGBA16F support 2020-10-11 20:34:34 +11:00
Geoffrey McRae
98e0e5fc0b [client] egl: correct invalid value for texture row length 2020-10-11 19:59:44 +11:00
Geoffrey McRae
8a9f004ff6 [host/client] fix invalid initialization of RGBA16F 2020-10-11 19:39:47 +11:00