iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
22.96k stars 1.06k forks source link

Update `wgpu` to `0.20` #2417

Open hecrj opened 2 weeks ago

hecrj commented 2 weeks ago

This PR updates wgpu to 0.20. Depends on #2416.

Unfortunately, this wgpu update doesn't seem to work very well on my end (Arch, X11, RTX 4090, NVIDIA drivers). 0.19 is smooth as butter for me, while in 0.20 the examples feel very sluggish and I constantly get a validation error:

2024-05-01T14:25:29.145657Z ERROR wgpu_hal::vulkan::instance: VALIDATION [VUID-vkAcquireNextImageKHR-semaphore-01779 (0x5717e75b)]
        Validation Error: [ VUID-vkAcquireNextImageKHR-semaphore-01779 ] Object 0: handle = 0x4fac1c0000000032, type = VK_OBJECT_TYPE_SEMAPHORE; | MessageID = 0x5717e75b | vkAcquireNextImageKHR():  Semaphore must not have any pending operations. The Vulkan spec states: If semaphore is not VK_NULL_HANDLE it must not have any uncompleted signal or wait operations pending (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-vkAcquireNextImageKHR-semaphore-01779)
2024-05-01T14:25:29.145682Z ERROR wgpu_hal::vulkan::instance:   objects: (type: SEMAPHORE, hndl: 0x4fac1c0000000032, name: ?)

I imagine there is something wrong with the release, although maybe I missed something. Let me know if it works for you!

hecrj commented 2 weeks ago

Opened an issue in the wgpu repo: https://github.com/gfx-rs/wgpu/issues/5644

matze commented 2 weeks ago

Works alright without validation errors and sluggish behavior on a Radeon RX 5600 XT but there is a lot more log output that there used to.

skygrango commented 2 weeks ago

RX 7900XTX no errors like yours

first wgpu-0.20

     Running benches/wgpu.rs (/home/menter/software/iced/target/release/deps/wgpu-2badaebd889b51ec)
Gnuplot not found, using plotters backend
wgpu — canvas (light) time:   [325.68 µs 326.59 µs 327.73 µs]
Found 12 outliers among 100 measurements (12.00%)
  5 (5.00%) high mild
  7 (7.00%) high severe

wgpu — canvas (heavy) time:   [371.11 µs 373.13 µs 375.81 µs]
Found 12 outliers among 100 measurements (12.00%)
  4 (4.00%) high mild
  8 (8.00%) high severe

wgpu - layered text (light)
                        time:   [141.67 µs 142.28 µs 142.98 µs]
Found 10 outliers among 100 measurements (10.00%)
  4 (4.00%) high mild
  6 (6.00%) high severe

wgpu - layered text (heavy)
                        time:   [4.5305 ms 4.5671 ms 4.6064 ms]
Found 2 outliers among 100 measurements (2.00%)
  1 (1.00%) high mild
  1 (1.00%) high severe

second cosmic-text-0.11

     Running benches/wgpu.rs (/home/menter/software/iced/target/release/deps/wgpu-8542c9a313f43b18)
Gnuplot not found, using plotters backend
wgpu — canvas (light) time:   [322.68 µs 323.36 µs 324.16 µs]
                        change: [-8.3115% -3.0241% +2.0292%] (p = 0.30 > 0.05)
                        No change in performance detected.
Found 12 outliers among 100 measurements (12.00%)
  4 (4.00%) high mild
  8 (8.00%) high severe

wgpu — canvas (heavy) time:   [369.82 µs 371.96 µs 374.69 µs]
                        change: [-13.772% -0.7633% +14.241%] (p = 0.92 > 0.05)
                        No change in performance detected.
Found 12 outliers among 100 measurements (12.00%)
  4 (4.00%) high mild
  8 (8.00%) high severe

wgpu - layered text (light)
                        time:   [139.25 µs 139.81 µs 140.45 µs]
                        change: [-6.7075% -1.6502% +3.6626%] (p = 0.58 > 0.05)
                        No change in performance detected.
Found 14 outliers among 100 measurements (14.00%)
  6 (6.00%) high mild
  8 (8.00%) high severe

wgpu - layered text (heavy)
                        time:   [4.3791 ms 4.4079 ms 4.4371 ms]
                        change: [-4.4980% -3.4845% -2.4238%] (p = 0.00 < 0.05)
                        Performance has improved.

wgpu - layered text (heavy) 螢幕截圖_20240502_232802-1

wgpu - layered text (light) 螢幕截圖_20240502_232906-1

wgpu — canvas (heavy) 螢幕截圖_20240502_232940

wgpu — canvas (light) 螢幕截圖_20240502_233015