hyprwm / Hyprland

Hyprland is an independent, highly customizable, dynamic tiling Wayland compositor that doesn't sacrifice on its looks.
https://hyprland.org
BSD 3-Clause "New" or "Revised" License
21.65k stars 901 forks source link

wl_surface.set_buffer_transform is ignored #3845

Open MaxVerevkin opened 1 year ago

MaxVerevkin commented 1 year ago

Hyprland Version

Hyprland, built from branch main at commit 0ba2e6870478bcf1af1b6508677b46a3484fb21f dirty (deco-positioner: don't remove hidden windows' data).

Bug or Regression?

Bug

Description

Calling wl_surface.set_buffer_transform has no effect.

How to reproduce

Let me know if a tiny test client is needed.

Crash reports, logs, images, videos

No response

vaxerski commented 1 year ago

I assume this works on sway.

Let me know if a tiny test client is needed.

would help

MaxVerevkin commented 11 months ago

Here is a simple example: https://github.com/MaxVerevkin/hyprland-bug/tree/master

In hyprland the image is static. In sway/river it flips every 500ms.

vaxerski commented 11 months ago

how do I compile this, I hate rust

MaxVerevkin commented 11 months ago

cargo run, that's it, no need to mess with meson/ninja/cmake/make/whatever.

MaxVerevkin commented 11 months ago

While looking into the renderer trying to fix this, I found a lot of loops like

for (auto& RECT : damage->getRects()) {
    scissor(&RECT);
    glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
}

Did you benchmark that this is faster (and not slower) than calling glDrawArrays once? Usually the goal is to minimize the number of draw calls, in this case by creating a batch of damaged quads and then calling glDraw\<whatever> once.

Is there already a way to see how much time each frame took to render?

vaxerski commented 11 months ago

damage is almost always 1 rect anyways. Feel free to benchmark tho

MaxVerevkin commented 11 months ago

Feel free to benchmark tho

Any suggestions how?

vaxerski commented 11 months ago

you can open a lot of clients and monitor gpu usage, I guess.

We also have GPU tracy points, you can try using tracy as well. Make sure to enable it in cmake. USE_TRACY and USE_TRACY_GPU iirc.

MaxVerevkin commented 11 months ago

Never used tracy, will try.

MaxVerevkin commented 11 months ago

image

Really?

vaxerski commented 11 months ago

aur tracy works just fine

MaxVerevkin commented 11 months ago

Wait, does it actually work for you?

Docs say that each function what you want to profile has to start with ZoneScoped;. I've added this to a few functions and only then I could see at least something

image

(...no, that's CPU scopes. weird)

vaxerski commented 11 months ago

you need to enable the GPU flag in cmake and then open the gpu zones tab

MaxVerevkin commented 11 months ago

I did that, I even see gpu zones listed in "options", but there is no zones tab

image

vaxerski commented 11 months ago

then you probably didnt enable the cmake gpu flag

MaxVerevkin commented 11 months ago

I am no cmake expert, but I'm pretty sure I did:

$ cmake -DCMAKE_BUILD_TYPE=Debug -DUSE_TRACY=1 -DUSE_TRACY_GPU=1 -Bbuild
-- TRACY_ENABLE: ON
...
-- Tracy GPU Profiling is turned on
...
vaxerski commented 11 months ago

dunno then, should work.

MaxVerevkin commented 3 months ago

set_buffer_transform is still ignored as of 0.41.2.

vaxerski commented 3 months ago

in -git it's working if transform is 0 or the same as the monitor's transform, so we can leave this open