cloudhead / rx

👾 Modern and minimalist pixel editor
https://discord.gg/xHggPjfsS9
GNU General Public License v3.0
3.1k stars 109 forks source link

macOS fullscreen laggy #21

Closed rudolfs closed 4 years ago

rudolfs commented 4 years ago

When going fullscreen on macOS moving the cursor becomes super slow. Weirdly this issue doesn't happen while screen recording is happening via QuickTime : D

Proof.

The package was built via:

rx » cargo install --git https://github.com/cloudhead/rx --tag v0.2.0 --locked --features metal
    Updating git repository `https://github.com/cloudhead/rx`
  Installing rx v0.2.0 (https://github.com/cloudhead/rx?tag=v0.2.0#a296ebf4)
    Updating git repository `https://github.com/cloudhead/rendy`
    Updating crates.io index
  Downloaded directories v2.0.2
  Downloaded png v0.15.0
  Downloaded raw-window-handle v0.1.2
  Downloaded gif v0.10.2
  Downloaded deflate v0.7.20
  Downloaded dirs-sys v0.3.4
  Downloaded rgx v0.1.5
  Downloaded inflate v0.4.5
  Downloaded glfw v0.32.0
  Downloaded color_quant v1.0.1
  Downloaded snap v0.2.5
  Downloaded lzw v0.10.0
  Downloaded adler32 v1.0.3
  Downloaded objc v0.2.6
  Downloaded glfw-sys v3.3.0
  Downloaded wgpu v0.3.0
  Downloaded malloc_buf v0.0.6
  Downloaded objc_exception v0.1.1
  Downloaded zerocopy v0.2.8
  Downloaded wgpu-native v0.3.3
  Downloaded gcc v0.3.55
  Downloaded cmake v0.1.41
  Downloaded gfx-backend-empty v0.3.0
  Downloaded gfx-backend-metal v0.3.0
  Downloaded gfx-hal v0.3.0
  Downloaded rendy-descriptor v0.4.0
  Downloaded hibitset v0.6.2
  Downloaded backtrace v0.3.34
  Downloaded colorful v0.2.1
  Downloaded derivative v1.0.2
  Downloaded relevant v0.4.2
  Downloaded zerocopy-derive v0.1.4
  Downloaded fxhash v0.2.1
  Downloaded cc v1.0.40
  Downloaded foreign-types v0.3.2
  Downloaded block v0.1.6
  Downloaded cocoa v0.18.4
  Downloaded range-alloc v0.1.0
  Downloaded storage-map v0.2.0
  Downloaded foreign-types-shared v0.1.1
  Downloaded core-graphics v0.17.3
  Downloaded metal v0.15.0
  Downloaded objc-foundation v0.1.1
  Downloaded atom v0.3.5
  Downloaded spirv_cross v0.15.0
  Downloaded objc_id v0.1.1
   Compiling proc-macro2 v0.4.30
   Compiling libc v0.2.62
   Compiling unicode-xid v0.1.0
   Compiling gcc v0.3.55
   Compiling syn v0.15.44
   Compiling cc v1.0.40
   Compiling semver-parser v0.7.0
   Compiling core-foundation-sys v0.6.2
   Compiling bitflags v1.1.0
   Compiling foreign-types-shared v0.1.1
   Compiling byteorder v1.3.2
   Compiling failure_derive v0.1.5
   Compiling rustc-demangle v0.1.16
   Compiling cfg-if v0.1.9
   Compiling log v0.4.8
   Compiling memchr v2.2.1
   Compiling block v0.1.6
   Compiling arrayvec v0.4.11
   Compiling smallvec v0.6.10
   Compiling scopeguard v1.0.0
   Compiling atom v0.3.5
   Compiling nodrop v0.1.13
   Compiling gfx-backend-metal v0.3.0
   Compiling copyless v0.1.4
   Compiling colorful v0.2.1
   Compiling range-alloc v0.1.0
   Compiling slab v0.4.2
   Compiling autocfg v0.1.5
   Compiling lazy_static v1.3.0
   Compiling crc32fast v1.2.0
   Compiling regex-syntax v0.6.11
   Compiling quick-error v1.2.2
   Compiling vec_map v0.8.1
   Compiling adler32 v1.0.3
   Compiling unicode-width v0.1.5
   Compiling termcolor v1.0.5
   Compiling color_quant v1.0.1
   Compiling lzw v0.10.0
   Compiling semver v0.9.0
   Compiling foreign-types v0.3.2
   Compiling cmake v0.1.41
   Compiling lock_api v0.3.1
   Compiling hibitset v0.6.2
   Compiling thread_local v0.3.6
   Compiling humantime v1.2.0
   Compiling inflate v0.4.5
   Compiling textwrap v0.11.0
   Compiling gif v0.10.2
   Compiling rustc_version v0.2.3
   Compiling num-traits v0.2.8
   Compiling storage-map v0.2.0
   Compiling objc_exception v0.1.1
   Compiling parking_lot_core v0.6.2
   Compiling parking_lot v0.9.0
   Compiling clap v2.33.0
   Compiling malloc_buf v0.0.6
   Compiling core-foundation v0.6.4
   Compiling raw-window-handle v0.1.2
   Compiling atty v0.2.13
   Compiling dirs-sys v0.3.4
   Compiling quote v0.6.13
   Compiling fxhash v0.2.1
   Compiling deflate v0.7.20
   Compiling snap v0.2.5
   Compiling aho-corasick v0.7.6
   Compiling directories v2.0.2
   Compiling core-graphics v0.17.3
   Compiling backtrace-sys v0.1.31
   Compiling spirv_cross v0.15.0
   Compiling glfw-sys v3.3.0
   Compiling png v0.15.0
   Compiling regex v1.2.1
   Compiling objc v0.2.6
   Compiling objc_id v0.1.1
   Compiling cocoa v0.18.4
   Compiling env_logger v0.6.2
   Compiling objc-foundation v0.1.1
   Compiling synstructure v0.10.2
   Compiling backtrace v0.3.34
   Compiling metal v0.15.0
   Compiling relevant v0.4.2
   Compiling glfw v0.32.0
   Compiling derivative v1.0.2
   Compiling zerocopy-derive v0.1.4
   Compiling failure v0.1.5
   Compiling gfx-hal v0.3.0
   Compiling zerocopy v0.2.8
   Compiling rendy-memory v0.4.0 (https://github.com/cloudhead/rendy#e08b64fb)
   Compiling rendy-descriptor v0.4.0
   Compiling gfx-backend-empty v0.3.0
   Compiling wgpu-native v0.3.3
   Compiling wgpu v0.3.0
   Compiling rgx v0.1.5
   Compiling rx v0.2.0 (https://github.com/cloudhead/rx?tag=v0.2.0#a296ebf4)
    Finished release [optimized] target(s) in 3m 14s
  Installing /Users/rudolfs/.cargo/bin/rx
   Installed package `rx v0.2.0 (https://github.com/cloudhead/rx?tag=v0.2.0#a296ebf4)` (executable `rx`)
rudolfs commented 4 years ago

Debug mode:

Screenshot 2019-09-29 at 15 25 37
cloudhead commented 4 years ago

Yikes - is it just full screen mode that is laggy, or also if you make the window quite big?

The 91ms is the average time it takes to render a frame, so that should be < 8ms normally.

rudolfs commented 4 years ago

No, only if it's fullscreen. If the window is stretched to cover the whole screen performance stays normal.

cloudhead commented 4 years ago

I'm able to reproduce this both with the glfw and winit backends, which leaves the rendering stack (rgx/wgpu/gfx-rs) as the likely culprit.

cloudhead commented 4 years ago

Ok, looks like a bug in wgpu-rs/gfx-rs which is not present anymore in latest master :thinking:

m4b commented 4 years ago

Yes I believe you all are hitting: https://github.com/gfx-rs/wgpu/pull/337

0.4 will be released soon and swapchain on Mac and iOS should be fixed :)

rbisewski commented 4 years ago

I'm experiencing something similar on Linux as well (using the open source amdgpu driver with vulkan support), though it mostly seems to occur if I edit files of greater size than 512x512.

Typically if I try to edit large files it just tends to freeze the program since rendering each frame tends to take in excess of 60 seconds or more.

cloudhead commented 4 years ago

Yeah full-screen is pretty much broken currently, until we upgrade our wgpu dependency. I'm waiting for them to release a 0.4 though.

cloudhead commented 4 years ago

This should now be fixed since updating to the newly released wgpu-0.4.0

rudolfs commented 4 years ago

Yay! It's smooth in full-screen now. 🔥