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

Port to wgpu #27

Merged
merged 23 commits into from
Jan 28, 2024
Merged

Port to wgpu #27

merged 23 commits into from
Jan 28, 2024

Conversation

Kl4rry
Copy link
Owner

@Kl4rry Kl4rry commented Jan 23, 2024

No description provided.

@Kl4rry
Copy link
Owner Author

Kl4rry commented Jan 23, 2024

@0323pin How is vulkan support on NetBSD? The OpenGL backend of wgpu is kinda scuffed. Like it segfaults if multiple threads are used.

@0323pin
Copy link
Contributor

0323pin commented Jan 23, 2024

@Kl4rry Honestly, I don't know.
Do you want me to try a build from 9c94202?
I can do that.

@Kl4rry
Copy link
Owner Author

Kl4rry commented Jan 23, 2024

Yes that would be nice. You can force it to use vulkan by using the env var WGPU_BACKEND=vulkan.

@0323pin
Copy link
Contributor

0323pin commented Jan 23, 2024

It builds fine,

===> Building for simp-3.4.1
   Compiling libc v0.2.152
   Compiling autocfg v1.1.0
   Compiling cfg-if v1.0.0
   Compiling pkg-config v0.3.29
   Compiling proc-macro2 v1.0.76
   [...]
   Compiling simp v3.4.1 (/usr/pkgsrc/wip/simp/work/simp-9c94202818c614a987bd20e077ae9243a5129e81)
   Compiling egui-winit v0.25.0
   Compiling ctrlc v3.4.2
   [...]
   Finished release [optimized] target(s) in 15m 55s

But ...

~> simp nik-5lzJbDKElQ8-unsplash.jpg
xkbcommon: ERROR: couldn't find a Compose file for locale "en_US.UTF-8" (mapped to "en_US.UTF-8")
PanicInfo { payload: Any { .. }, message: Some(tessellate called before first call to Context::run()), location: Location { file: "/usr/pkgsrc/wip/simp/work/vendor/egui-0.25.0/src/context.rs", line: 1813, col: 18 }, can_unwind: true, force_no_backtrace: false }
Exception: simp exited with 1
$ export WGPU_BACKEND=vulkan
$ simp max-burgi-3e-Hdr5csOg-unsplash.jpg
xkbcommon: ERROR: couldn't find a Compose file for locale "en_US.UTF-8" (mapped to "en_US.UTF-8")
PanicInfo { payload: Any { .. }, message: Some(tessellate called before first call to Context::run()), location: Location { file: "/usr/pkgsrc/wip/simp/work/vendor/egui-0.25.0/src/context.rs", line: 1813, col: 18 }, can_unwind: true, force_no_backtrace: false }

I wouldn't bother with the xkbcommon error, I get the same launching alacritty and it works fine.

@Kl4rry
Copy link
Owner Author

Kl4rry commented Jan 23, 2024

Interesting. The same panic appears under some conditions on windows so I have likely done something worng.

@0323pin
Copy link
Contributor

0323pin commented Jan 23, 2024

Ok, do you want to dig into it first and ping me for a new build soon or, how should we proceed?

@Kl4rry
Copy link
Owner Author

Kl4rry commented Jan 23, 2024

Yes, you can try this fed093c commit. It fixed the crash on windows.

@0323pin
Copy link
Contributor

0323pin commented Jan 24, 2024

@Kl4rry It works now :)

2024-01-24-055748_1366x768_scrot

Also, when using,

$ export WGPU_BACKEND=vulkan
$ simp sung-jin-cho-p3g6hLNMAGw-unsplash.jpg

If I'm using this correctly, that's another question :)

@Kl4rry
Copy link
Owner Author

Kl4rry commented Jan 24, 2024

Good that it works. But I not 100% sure it's actually running on vulkan. Its not really clear from the docs which one is picked the desired one is not available.

@0323pin
Copy link
Contributor

0323pin commented Jan 24, 2024

I'm not sure it's using vulkan either. Anyway to check?
No rush, I'm out tonight.

@0323pin
Copy link
Contributor

0323pin commented Jan 25, 2024

Did you find out how to check which back-end is being used?

2024-01-25-230501_1366x768_scrot

@Kl4rry
Copy link
Owner Author

Kl4rry commented Jan 25, 2024

Yes, 854b4eb this commit should display the used backend in the about menu. It should also force netbsd to use vulkan so I think it should crash if it is not working.

@0323pin
Copy link
Contributor

0323pin commented Jan 26, 2024

@Kl4rry Building from 854b4eb,

error: failed to run custom build command for `simp v3.4.1 (/usr/pkgsrc/wip/simp/work/simp-854b4ebd4b127d295c82515f55c2ed3ad5321a6d)`

Caused by:
  process didn't exit successfully: `/usr/pkgsrc/wip/simp/work/simp-854b4ebd4b127d295c82515f55c2ed3ad5321a6d/target/release/build/simp-f98a220f742dd588/build-script-build` (exit status: 101)
  --- stdout
  cargo:rustc-env=GIT_HASH=54f8e8919791c01c292f495d7a1a43db812ab338

  cargo:rerun-if-changed=Cargo.toml

  --- stderr
  error: no such command: `about`

  	Did you mean `audit`?

  	View all installed commands with `cargo --list`
  	Find a package to install `about` with `cargo search cargo-about`
  error: no such command: `about`

  	Did you mean `audit`?

  	View all installed commands with `cargo --list`
  	Find a package to install `about` with `cargo search cargo-about`
  thread 'main' panicked at build.rs:58:9:
  assertion failed: exit_status.success()
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
*** Error code 101

Stop.

Same from 18b7458

EDIT: I've packaged and merged cargo-about, re-building from 18b7458 now.

EDIT_2:
It builds now,

warning: unused variable: `instance_descriptor`
  --> src/main.rs:92:13
   |
92 |         let instance_descriptor = wgpu::InstanceDescriptor {
   |             ^^^^^^^^^^^^^^^^^^^ help: if this is intentional, prefix it with an underscore: `_instance_descriptor`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: `simp` (bin "simp") generated 1 warning (run `cargo fix --bin "simp"` to apply 1 suggestion)
    Finished release [optimized] target(s) in 11m 55s

But, vulkan doesn't seem to be supported.

2024-01-26-094858_1366x768_scrot

It's the same even when setting WGPU_BACKEND=vulkan

@Kl4rry
Copy link
Owner Author

Kl4rry commented Jan 26, 2024

Aight then, I will just keep supporting the GL backend.

@0323pin
Copy link
Contributor

0323pin commented Jan 26, 2024

Aight then, I will just keep supporting the GL backend.

Thank you!

@Kl4rry Kl4rry merged commit fe777d9 into main Jan 28, 2024
3 checks passed
@Kl4rry Kl4rry deleted the wgpu branch January 28, 2024 15:15
@0323pin
Copy link
Contributor

0323pin commented Jan 31, 2024

@Kl4rry Thank you for your work and for supporting NetBSD.

I've asked internally and the vulkan driver is still absent. There was a bounty over a year ago but, apparently no one has volunteered 😞

@Kl4rry
Copy link
Owner Author

Kl4rry commented Jan 31, 2024

Its not too much trouble. OpenGL still has some advantages for some weird reason on windows. It has faster startup and has less flickering when resizing the window. But mip maps are broken in the wgpu OpenGL backend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants