On Wed Aug 28 15:52:45 2024 +0000, Alexandros Frantzis wrote:
`wp_viewport_set_source` makes it a compositor error to have (quoting from the spec) "a source rectangle that is partially or completely outside of the non-NULL wl_buffer". This makes it tricky to use at the moment since the code is not designed to respect this requirement. For example, here is a (partial) log of a protocol error I am seeing with this branch: [set_source_error.txt](/uploads/406f1cc729960c30defcae2871262324/set_source_error.txt), and there are probably other error scenarios involving multiple threads, GL/VK rendering threads etc. In any case, pursuing this path this needs some care. Note that I have tried using `wp_viewport_set_source` myself in the past, but abandoned it because I found it to be too fragile for the benefit it brought. Note that not all compositors enforce this error strictly, so this branch may work with some compositors but not others. Also, I am seeing some strange (and somewhat inconsistent between compositors) results with this change when the output is scaled (i.e., dpi > 96), but I am not sure yet what's the problem.
Thanks for the details it looks a bit sensitive... but hopefully we could make it work. The advantages of it are IMO worth the try, and reallocating a shared memory file on every window resize operation, even one pixel, looks like a waste of resources.