Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

incomplete scroll paints when using opengl:gtk #4201

Closed
aerusso opened this issue Apr 27, 2024 · 13 comments
Closed

incomplete scroll paints when using opengl:gtk #4201

aerusso opened this issue Apr 27, 2024 · 13 comments
Labels

Comments

@aerusso
Copy link
Contributor

aerusso commented Apr 27, 2024

Describe the bug
With opengl GTK sometimes remote windows appear "clear".

To Reproduce
Steps to reproduce the behavior:

  1. server command: xpra start :$display --start-new-commands=yes --daemon=no --systemd-run=no
  2. client command: xpra attach ssh://$user@$host/$display --opengl=yes:gtk -dpaint
  3. this was the nextcloud client app, I clicked on the drop-down menu for the user, repeatedly. I was also able to get similar artifacts when using the "boats" program from http://boats.sf.net (comes with Debian). (I have no clue what this program/game does, I just know that it depends on libqt5gui5t64 on Debian, and I suspect that it's exercising a similar path as nextcloud-desktop). This program can create similar artifacts when you select the red "create mark" button, causing the cursor have an associated circled number that moves with the mouse when the mouse moves; just kind of move the mouse all around the canvas area, eventually the paints get confused. It looks like programs that directly draw on a canvas are having problems (but I do not have a minimal reproducer program).

System Information (please complete the following information):

  • Server OS: Debian unstable
  • Client OS: Debian unstable
  • Xpra Server Version 6.0
  • Xpra Client Version 6.0 (REGRESSION relative to 5.0.8/cannot reproduce with 5.0.8)

Additional context
Here is the out put of the log with -d paint:

client log
2024-04-27 00:08:03,902 draw_region(0, 0, 447, 601, scroll, 11 bytes, 0, typedict({'flush': 1, 'window-size': (447, 601)}), [<function WindowClient._do_draw.<locals>.record_decode_time at 0x7f363b7459e0>])
2024-04-27 00:08:03,903 draw_region(0, 69, 447, 186, webp, 3496 bytes, 0, typedict({'rgb_format': 'BGRA', 'quality': 100, 'has_alpha': True, 'flush': 0, 'window-size': (447, 601)}), [<function WindowClient._do_draw.<locals>.record_decode_time at 0x7f363b745bc0>, <bound method ClientWindowBase.after_draw_refresh of GLClientWindow(2 : GLAreaBacking(0x2, (447, 601)))>])
2024-04-27 00:08:03,904 do_scroll_paints(<__gi__.GdkWaylandGLContext object at 0x7f365d7ba240 (GdkWaylandGLContext at 0x4b7e280)>, ((0, 266, 447, 81, 0, -1), (0, 266, 447, 81, 0, -2), (0, 266, 447, 81, 0, -3), (0, 266, 447, 81, 0, -4), (0, 266, 447, 81, 0, -5), (0, 266, 447, 81, 0, -6), (0, 266, 447, 81, 0, -7), (0, 266, 447, 81, 0, -8), (0, 266, 447, 81, 0, -9), (0, 266, 447, 81, 0, -10), (0, 266, 447, 81, 0, -11)), 1)
2024-04-27 00:08:03,904 copy_fbo(447, 601, 0, 0, 0, 0)
2024-04-27 00:08:03,904 swap_fbos()
2024-04-27 00:08:03,904 record_decode_time(True, ) wid=2, scroll: 447x601, 2.2ms
2024-04-27 00:08:03,904 GLAreaBacking(0x2, (447, 601)).gl_paint_rgb(BGRA, 332568 bytes, x=0, y=69, width=447, height=186, rowstride=1788, options=typedict({'rgb_format': 'BGRA', 'quality': 100, 'has_alpha': True, 'flush': 0, 'window-size': (447, 601), 'encoding': 'webp'}))
2024-04-27 00:08:03,905 gravity_adjust(0, 69, typedict({'rgb_format': 'BGRA', 'quality': 100, 'has_alpha': True, 'flush': 0, 'window-size': (447, 601), 'encoding': 'webp'})) window_size=(447, 601), size=(447, 601), gravity=10
2024-04-27 00:08:03,905 record_decode_time(True, ) wid=2, webp: 447x186, 1.6ms
2024-04-27 00:08:03,905 after_draw_refresh(True, '') pending_refresh=[], backing=GLAreaBacking(0x2, (447, 601))
2024-04-27 00:08:03,905 repaint(0, 0, 447, 601) widget=<Gtk.GLArea object at 0x7f3654d10400 (GtkGLArea at 0x4acd990)>
2024-04-27 00:08:03,905 draw_fbo(<cairo.Context object at 0x7f363b713670>)
2024-04-27 00:08:03,905 on_render(<Gtk.GLArea object at 0x7f3654d10400 (GtkGLArea at 0x4acd990)>, <__gi__.GdkWaylandGLContext object at 0x7f365d7ba240 (GdkWaylandGLContext at 0x4b7e280)>)
2024-04-27 00:08:03,906 do_present_fbo(<__gi__.GdkWaylandGLContext object at 0x7f365d7ba240 (GdkWaylandGLContext at 0x4b7e280)>) will blit [(0, 0, 447, 601)]
2024-04-27 00:08:03,906 window viewport for self.render_size=(447, 601) and (0, 0, 0, 0) with scale factor 1: (0, 0, 447, 601)
2024-04-27 00:08:03,906 do_gl_show(0)
2024-04-27 00:08:03,906 GLAreaBacking(0x2, (447, 601)).do_present_fbo() done
2024-04-27 00:08:03,931 draw_fbo(<cairo.Context object at 0x7f363b713670>)
server log
2024-04-27 00:08:03,917 client   3 @46.678 draw_region(0, 0, 447, 601, scroll, 11 bytes, 0, typedict({'flush': 1, 'window-size': (447, 601)}), [<function WindowClient._do_draw.<locals>.record_decode_time at 0x7f363b7459e0>])                                           
2024-04-27 00:08:03,917 client   3 @46.679 draw_region(0, 69, 447, 186, webp, 3496 bytes, 0, typedict({'rgb_format': 'BGRA', 'quality': 100, 'has_alpha': True, 'flush': 0, 'window-size': (447, 601)}), [<function WindowClient._do_draw.<locals>.record_decode_time at 0x7f363b745bc0>, <bound method ClientWindowBase.after_draw_refresh of GLClientWindow(2 : GLAreaBacking(0x2, (447, 601)))>])
2024-04-27 00:08:03,918 client   3 @46.679 do_scroll_paints(<__gi__.GdkWaylandGLContext object at 0x7f365d7ba240 (GdkWaylandGLContext at 0x4b7e280)>, ((0, 266, 447, 81, 0, -1), (0, 266, 447, 81, 0, -2), (0, 266, 447, 81, 0, -3), (0, 266, 447, 81, 0, -4), (0, 266, 447, 81, 0, -5), (0, 266, 447, 81, 0, -6), (0, 266, 447, 81, 0, -7), (0, 266, 447, 81, 0, -8), (0, 266, 447, 81, 0, -9), (0, 266, 447, 81, 0, -10), (0, 266, 447, 81, 0, -11)), 1)
2024-04-27 00:08:03,918 client   3 @46.679 copy_fbo(447, 601, 0, 0, 0, 0)                                                                                                                                                                                                                                                                                                                      
2024-04-27 00:08:03,918 client   3 @46.680 swap_fbos()                                                                                                                                                                                                                     
2024-04-27 00:08:03,918 client   3 @46.680 record_decode_time(True, ) wid=2, scroll: 447x601, 2.2ms                                                                            
2024-04-27 00:08:03,919 client   3 @46.680 GLAreaBacking(0x2, (447, 601)).gl_paint_rgb(BGRA, 332568 bytes, x=0, y=69, width=447, height=186, rowstride=1788, options=typedict({'rgb_format': 'BGRA', 'quality': 100, 'has_alpha': True, 'flush': 0, 'window-size': (447, 601), 'encoding': 'webp'}))                                                                                                                                                      
2024-04-27 00:08:03,919 client   3 @46.680 gravity_adjust(0, 69, typedict({'rgb_format': 'BGRA', 'quality': 100, 'has_alpha': True, 'flush': 0, 'window-size': (447, 601), 'encoding': 'webp'})) window_size=(447, 601), size=(447, 601), gravity=10                                                                                                                                                
2024-04-27 00:08:03,919 client   3 @46.680 record_decode_time(True, ) wid=2, webp: 447x186, 1.6ms                                                                                                                                                                                                    
2024-04-27 00:08:03,919 client   3 @46.680 after_draw_refresh(True, '') pending_refresh=[], backing=GLAreaBacking(0x2, (447, 601))                                                                                                                                                                   
2024-04-27 00:08:03,919 client   3 @46.680 repaint(0, 0, 447, 601) widget=<Gtk.GLArea object at 0x7f3654d10400 (GtkGLArea at 0x4acd990)>                                                                                                                
2024-04-27 00:08:03,919 client   3 @46.681 draw_fbo(<cairo.Context object at 0x7f363b713670>)                                                                                  
2024-04-27 00:08:03,921 client   3 @46.681 on_render(<Gtk.GLArea object at 0x7f3654d10400 (GtkGLArea at 0x4acd990)>, <__gi__.GdkWaylandGLContext object at 0x7f365d7ba240 (GdkWaylandGLContext at 0x4b7e280)>)               
2024-04-27 00:08:03,921 client   3 @46.681 do_present_fbo(<__gi__.GdkWaylandGLContext object at 0x7f365d7ba240 (GdkWaylandGLContext at 0x4b7e280)>) will blit [(0, 0, 447, 601)]                                                                                                                                                                                                                    
2024-04-27 00:08:03,921 client   3 @46.681 window viewport for self.render_size=(447, 601) and (0, 0, 0, 0) with scale factor 1: (0, 0, 447, 601)                                                                                                                                                    
2024-04-27 00:08:03,921 client   3 @46.681 do_gl_show(0)                                                                                                                                                                                                
2024-04-27 00:08:03,921 client   3 @46.681 GLAreaBacking(0x2, (447, 601)).do_present_fbo() done                                                                                                                  
2024-04-27 00:08:03,945 client   3 @46.706 draw_fbo(<cairo.Context object at 0x7f363b713670>)

I did trim the log from before the distortion began; I can try to get a more complete log if it would be helpful.

@aerusso aerusso added the bug Something isn't working label Apr 27, 2024
@totaam
Copy link
Collaborator

totaam commented Apr 27, 2024

Can you include a screenshot of the problematic paints?
What GPU and driver are you using? (the output of xpra opengl)
Can you reproduce it with --opengl=force:native ?
What about turning off scroll encoding? --encodings=all,-scroll

@aerusso
Copy link
Contributor Author

aerusso commented Apr 27, 2024

  1. weird-artifact

My desktop background is black, I've redacted some text with 255,0,0 red (i.e., there is no artifact on the titlebar).

The black background is "clear". I.e., if I drag that xpra client window over another window, I can see the other window, beneath it through the remote xpra window:

weird-artifact-2

That image was made by moving the kolourpaint window beneath the nextcloud window AFTER the corruption started.

The corruption often goes away after resizing or presumably any client repaint of the affected area.

GLU=1.3
array-handlers=<OpenGL.arrays.numpymodule.NumpyHandler object at 0x7fd54cb51110>
backend=egl
max-viewport-dims=16384, 16384
opengl=4.6
platform=linux
pyopengl=3.1.7
renderer=AMD Radeon Graphics (radeonsi, gfx1103_r1, LLVM 17.0.6, DRM 3.57, 6.7.9-amd64)
safe=True
shading-language-version=4.60
success=True
texture-size-limit=16384
vendor=AMD
zerocopy=
  1. I cannot reproduce with --opengl=force:native, presumably because it falls back to no acceleration:
2024-04-27 06:47:56,870 No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'
2024-04-27 06:47:56,920 Warning: cannot import OpenGL window module native
2024-04-27 06:47:56,920  'EGLPlatform' object has no attribute 'GLX'
2024-04-27 06:47:56,920 Warning: no OpenGL backend module found

(I do not have pyopengl_accelerate installed).

  1. I'm not able to reproduce with the client starting with --encodings=all,-scroll

@totaam totaam changed the title (probably) incomplete paints when using opengl:gtk incomplete scroll paints when using opengl:gtk Apr 27, 2024
@totaam
Copy link
Collaborator

totaam commented Apr 27, 2024

I can reproduce it, and I have no idea how to fix it.
Although the context is now EGL / core context, the do_scroll_paints method is unchanged. (only cosmetic formatting changes in the while method)
This is the one from v5.x:

def do_scroll_paints(self, context, scrolls, flush:int=0, callbacks:Iterable[Callable]=()) -> None:
log("do_scroll_paints%s", (context, scrolls, flush))
if not context:
log("%s.do_scroll_paints(..) no context!", self)
fire_paint_callbacks(callbacks, False, "no opengl context")
return
def fail(msg):
log.error("Error: %s", msg)
fire_paint_callbacks(callbacks, False, msg)
bw, bh = self.size
self.copy_fbo(bw, bh)
for x,y,w,h,xdelta,ydelta in scrolls:
if abs(xdelta)>=bw:
fail(f"invalid xdelta value: {xdelta}, backing width is {bw}")
continue
if abs(ydelta)>=bh:
fail(f"invalid ydelta value: {ydelta}, backing height is {bh}")
continue
if ydelta==0 and xdelta==0:
fail("scroll has no delta!")
continue
if w<=0 or h<=0:
fail(f"invalid scroll area size: {w}x{h}")
continue
# these should be errors,
# but desktop-scaling can cause a mismatch between the backing size
# and the real window size server-side... so we clamp the dimensions instead
if x+w>bw:
w = bw-x
if y+h>bh:
h = bh-y
if x+w+xdelta>bw:
w = bw-x-xdelta
if w<=0:
continue #nothing left!
if y+h+ydelta>bh:
h = bh-y-ydelta
if h<=0:
continue #nothing left!
if x+xdelta<0:
rect = (x, y, w, h)
fail(f"horizontal scroll by {xdelta}"
+f" rectangle {rect} overflows the backing buffer size {self.size}")
continue
if y+ydelta<0:
rect = (x, y, w, h)
fail(f"vertical scroll by {ydelta}"
+f" rectangle {rect} overflows the backing buffer size {self.size}")
continue
#opengl buffer is upside down, so we must invert Y coordinates: bh-(..)
glBlitFramebuffer(x, bh-y, x+w, bh-(y+h),
x+xdelta, bh-(y+ydelta), x+w+xdelta, bh-(y+h+ydelta),
GL_COLOR_BUFFER_BIT, GL_NEAREST)
self.paint_box("scroll", x+xdelta, y+ydelta, x+w+xdelta, y+h+ydelta)
glFlush()
self.swap_fbos()
target = GL_TEXTURE_RECTANGLE_ARB
#restore normal paint state:
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, target, self.textures[TEX_FBO], 0)
glBindFramebuffer(GL_READ_FRAMEBUFFER, self.offscreen_fbo)
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, self.offscreen_fbo)
glBindFramebuffer(GL_FRAMEBUFFER, self.offscreen_fbo)
glBindTexture(target, 0)
glDisable(target)
fire_paint_callbacks(callbacks, True)
if not self.draw_needs_refresh:
self.present_fbo(0, 0, bw, bh, flush)

And the current one:
def do_scroll_paints(self, context, scrolls, flush=0, callbacks: Iterable[Callable] = ()) -> None:
log("do_scroll_paints%s", (context, scrolls, flush))
if not context:
log("%s.do_scroll_paints(..) no context!", self)
fire_paint_callbacks(callbacks, False, "no opengl context")
return
def fail(msg):
log.error("Error: %s", msg)
fire_paint_callbacks(callbacks, False, msg)
bw, bh = self.size
self.copy_fbo(bw, bh)
for x, y, w, h, xdelta, ydelta in scrolls:
if abs(xdelta) >= bw:
fail(f"invalid xdelta value: {xdelta}, backing width is {bw}")
continue
if abs(ydelta) >= bh:
fail(f"invalid ydelta value: {ydelta}, backing height is {bh}")
continue
if ydelta == 0 and xdelta == 0:
fail("scroll has no delta!")
continue
if w <= 0 or h <= 0:
fail(f"invalid scroll area size: {w}x{h}")
continue
# these should be errors,
# but desktop-scaling can cause a mismatch between the backing size
# and the real window size server-side... so we clamp the dimensions instead
if x + w > bw:
w = bw - x
if y + h > bh:
h = bh - y
if x + w + xdelta > bw:
w = bw - x - xdelta
if w <= 0:
continue # nothing left!
if y + h + ydelta > bh:
h = bh - y - ydelta
if h <= 0:
continue # nothing left!
if x + xdelta < 0:
rect = (x, y, w, h)
fail(f"horizontal scroll by {xdelta} rectangle {rect} overflows the backing buffer size {self.size}")
continue
if y + ydelta < 0:
rect = (x, y, w, h)
fail(f"vertical scroll by {ydelta} rectangle {rect} overflows the backing buffer size {self.size}")
continue
# opengl buffer is upside down, so we must invert Y coordinates: bh-(..)
glBlitFramebuffer(x, bh - y, x + w, bh - (y + h),
x + xdelta, bh - (y + ydelta), x + w + xdelta, bh - (y + h + ydelta),
GL_COLOR_BUFFER_BIT, GL_NEAREST)
self.paint_box("scroll", x + xdelta, y + ydelta, x + w + xdelta, y + h + ydelta)
glFlush()
self.swap_fbos()
target = GL_TEXTURE_RECTANGLE
# restore normal paint state:
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, target, self.textures[TEX_FBO], 0)
glBindFramebuffer(GL_READ_FRAMEBUFFER, self.offscreen_fbo)
glBindFramebuffer(GL_DRAW_FRAMEBUFFER, self.offscreen_fbo)
glBindFramebuffer(GL_FRAMEBUFFER, self.offscreen_fbo)
glBindTexture(target, 0)
fire_paint_callbacks(callbacks, True)
if not self.draw_needs_refresh:
self.present_fbo(context, 0, 0, bw, bh, flush)

@totaam
Copy link
Collaborator

totaam commented Apr 27, 2024

'EGLPlatform' object has no attribute 'GLX'

Ah, is it a Wayland desktop? (then native isn't available)

@totaam
Copy link
Collaborator

totaam commented May 1, 2024

So, this is a strange one.
I first thought that this was a true regression, but I can reproduce some corruption with v5.x LTS, just less often and far less drastic.
It would seem that the new OpenGL paint code is to blame - despite being unchanged since v5.x
But I can also reproduce some corruption with --opengl=no.

If I don't make progress, I could disable scroll for the next update as this will "fix" things - at least temporarily, buying some time.

@bugreporter42
Copy link

opengl=force:native has the same issue (client version 6.0). I'm getting a lot of corruption between different windows (using shadow for a remote desktop).

Client version 4.4.5 works correctly.

@cherio
Copy link

cherio commented May 14, 2024

Same issue when connecting from xpra 6.0-1 client (Arch linux, XFCE/GTK) to either another 6.0-1 server (Arch linux) or v6.0-r0 server (ubuntu 22.04) from xpra stable repository.

2024-05-13 16:14:27,738 Xpra GTK3 X11 client version 6.0-r0
2024-05-13 16:14:27,742  running on Linux 6.8.9-arch1-2
2024-05-13 16:14:27,742  cpython 3.12
2024-05-13 16:14:27,742  window manager is 'Xfwm4'
2024-05-13 16:14:27,941 GStreamer version 1.24.3
2024-05-13 16:14:27,968 created unix domain sockets:
2024-05-13 16:14:27,968  '/run/user/1000/xpra/clients/client-host-298575'
2024-05-13 16:14:28,345 No OpenGL_accelerate module loaded: No module named 'OpenGL_accelerate'
2024-05-13 16:14:28,539 OpenGL enabled on 'AMD Radeon Graphics'
2024-05-13 16:14:28,551  keyboard settings: rules=evdev, model=pc105, layout=us
2024-05-13 16:14:28,553  desktop size is 2560x1440:
2024-05-13 16:14:28,553   :0.0 (677x381 mm - DPI: 96x96) workarea: 2560x1420
2024-05-13 16:14:28,553     SAM HDMI-A-1     (597x336 mm - DPI: 109x109)
2024-05-13 16:14:29,162 enabled remote logging
2024-05-13 16:14:29,163 Xpra X11 seamless server version 6.0
2024-05-13 16:14:29,206 Attached to xpra server at tcp://localhost:12345/6
2024-05-13 16:14:29,206  (press Control-C to detach)

Previous Arch xpra-4.4.5-3 client did not have this issue, although it could never successfully use OpenGL in the first place, at least in my experience.

Setting --opengl=no seems to solve the issue, or at least make it unnoticeable.

@alexisshaw
Copy link

alexisshaw commented May 23, 2024

Xpra client 6.0 on Windows has this issue, and the v5.0.8 client doesn't, though it successfully used openGL on 5.0.8

@totaam
Copy link
Collaborator

totaam commented May 23, 2024

v6.0.1 will have scroll encoding disabled until I can figure out where the problem comes from: a65e0e2

@totaam
Copy link
Collaborator

totaam commented Jul 27, 2024

I had forgotten to disable it again for 6.1: 8c05f44

After adding support for another fast hashing function: google's cityhash and replacing xxh3:

diff --git a/xpra/server/window/motion.pyx b/xpra/server/window/motion.pyx
index 1f7928eff3..b5c2beea17 100644
--- a/xpra/server/window/motion.pyx
+++ b/xpra/server/window/motion.pyx
@@ -15,7 +15,7 @@ from xpra.log import Logger
 log = Logger("encoding", "scroll")
 
 from xpra.buffers.membuf cimport memalign, buffer_context  # pylint: disable=syntax-error
-from xpra.buffers.xxh cimport xxh3
+from xpra.buffers.cityhash cimport cityhash64
 from xpra.util.rectangle import rectangle
 
 
@@ -124,7 +124,7 @@ cdef class ScrollData:
             assert row_len<=rowstride, "invalid row length: %ix%i=%i but rowstride is %i" % (width, bpp, width*bpp, rowstride)
             with nogil:
                 for i in range(height):
-                    a2[i] = xxh3(buf, row_len)
+                    a2[i] = cityhash64(buf, row_len)
                     buf += rowstride
 
 

We can also use the much slower hashlib variants:

diff --git a/xpra/server/window/motion.pyx b/xpra/server/window/motion.pyx
index 1f7928eff3..74076eb83d 100644
--- a/xpra/server/window/motion.pyx
+++ b/xpra/server/window/motion.pyx
@@ -117,15 +117,18 @@ cdef class ScrollData:
         cdef uint64_t *a2 = self.a2
         cdef uint16_t i
         cdef uint8_t *buf
+        from hashlib import sha256
+        from struct import unpack
         with buffer_context(pixels) as bc:
             buf = <uint8_t*> (<uintptr_t> int(bc))
             assert len(bc)>=min_buf_len, "buffer length=%i is too small for %ix%i with rowstride %i, should be %i" % (
                     len(bc), width, height, rowstride, min_buf_len)
             assert row_len<=rowstride, "invalid row length: %ix%i=%i but rowstride is %i" % (width, bpp, width*bpp, rowstride)
-            with nogil:
-                for i in range(height):
-                    a2[i] = xxh3(buf, row_len)
-                    buf += rowstride
+            for i in range(height):
+                row = buf[:row_len]
+                digest = sha256(row, usedforsecurity=False).digest()
+                a2[i] = unpack(">Q", digest[:8])[0]
+                buf += rowstride
 
 
     def calculate(self, uint16_t max_distance=1000) -> None:

The visual artifacts persists.

So it's unlikely to be caused by unexpected 64-bit hash collisions.

c4cc39b added the XPRA_IMAGE_ALWAYS_FREEZE toggle:

ALWAYS_FREEZE = envbool("XPRA_IMAGE_ALWAYS_FREEZE", False)

So the pixels probably aren't getting corrupted in between the time we calculate the checksum and the time we read them since the data is only held in this one image wrapper object?

totaam added a commit that referenced this issue Jul 30, 2024
totaam added a commit that referenced this issue Jul 30, 2024
cloning the options later meant that may_use_scrolling tagged the image with the boolean 'scroll' to indicate the scroll detection had already been used,
but the flag was later lost and scroll detection would run again in some cases, comparing the current image with itself..
totaam added a commit that referenced this issue Jul 31, 2024
totaam added a commit that referenced this issue Jul 31, 2024
* always use an 'XPRA_' prefix for env vars,
* more readable output,
* get the window size as early as possible,
* use the correct cairo format for rgb updates ('rgb24' only means no alpha, 'rgb_format' tells us the number of pixel components)
totaam added a commit that referenced this issue Aug 1, 2024
@totaam
Copy link
Collaborator

totaam commented Aug 6, 2024

References:

Should we be using render buffers instead of textures?
glFramebufferRenderbuffer states that Renderbuffers cannot be attached to the default draw and read framebuffer, so they are not valid targets of these commands so this would prevent us from copying from the render buffer?

@totaam
Copy link
Collaborator

totaam commented Aug 7, 2024

I can't hold up the 6.1.1 release any longer, so scroll is disabled in the client again..

@totaam
Copy link
Collaborator

totaam commented Aug 13, 2024

TLDR: use glClear(GL_COLOR_BUFFER_BIT).
I don't understand why the fix works, but it does: 617aa2e was a fix for desktop scaling (#4324) and applying the same fix to scroll paints fixes that too: 342dfa0


Why do we need to glClear the FBO since we're copying 100% of the source FBO into it immediately after?
Why would the previous contents matter at all?
And the textures attached to the fbos should have been cleared anyway since we glTexImage2D them with a NULL buffer on the statement just before that!?:

glTexImage2D(target, 0, self.internal_format, w, h, 0, GL_RGBA, GL_UNSIGNED_BYTE, None)

@totaam totaam closed this as completed Aug 13, 2024
totaam added a commit that referenced this issue Aug 13, 2024
This reverts commit 013123a.

This should work properly again with OpenGL.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants