-
-
Notifications
You must be signed in to change notification settings - Fork 123
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
Bump wgpu
to 0.19 and winit
to 0.29
#391
Conversation
There is one major bug that manifests in the
Making the window smaller doesn't crash - only larger. Removing the Another annoyance that only happens with my fork is that key events are logged to the terminal like so:
I don't know why this happens. I'd appreciate help diagnosing the cause of both of these problems, and would consider them a current blocker. My fork: https://github.com/mkrasnitski/imgui-wgpu-rs. The only changes I made to the lib itself are to |
This is printed by the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some comments. I think the one todo!
is worth addressing. But also, now that I review the value for other compressed texture formats, I'm not even sure if those are correct...
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor { | ||
backends: self.backend, | ||
..Default::default() | ||
}); | ||
|
||
// TODO: Use `options.pixel_aspect_ratio` to stretch the scaled texture | ||
let surface = unsafe { instance.create_surface(self.surface_texture.window) }?; | ||
let surface = instance.create_surface(self.surface_texture.window)?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is ... incredible! Does that mean #238 is fixed, and we can add #![forbid(unsafe_code)]
back to the lib?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised my approach worked. Since the handle traits have auto-impls for &W
, I was able to switch from &'win W
to W
bounded on + 'win
, which means you can also pass owned objects which satisfy a + 'static
bound. This way I was able to overcome the borrow checker for some of the examples by using Arc
.
Looks like |
That definitely seems like it was accidentally left in. Probably worth a PR to EDIT: For reference: imgui-rs/imgui-rs#763 |
Seems like CI is failing because of |
Let's just do that. We'll eventually be increasing the MSRV to 1.74 anyway. Might as well do it early for the next release with breaking changes. |
fa2f451
to
7bc8a32
Compare
Oh, didn't see the other "MSRV"-style CI checks. I guess I should bump the 1.70 test version to 1.74, but the Rust-version check seems redundant. Especially because the external crate takes a git dependency on the git head of this project, which means it doesn't even use the current PR for testing. |
That check is there to handle this clause from our MSRV policy:
Because dependencies in the examples tend to require a newer version of the compiler than the library needs, testing the two versions independently allows the library to require a compiler version that diverges from the examples. Using the git HEAD is an unfortunate case of laziness where I just never added a way to select the correct branch or PR. There is more information on this setup here: So, no. It is definitely not redundant. |
Thanks for the explanation, that makes sense.
This is unfortunate because this PR adds a dependency on the |
It is valid criticism and thank you for the reminder. I am currently OK with doing the maintainer thing and keeping CI happy post-merge with additional PRs. (That responsibility falls on me, not other contributors.) |
Excitingly looking forward to this merging as I'm working on a project to add egui to my existing winit project using pixels. However, I'm concerned about the new lifetime requirement on I specifically switched to winit/pixels to get away from some of the performance issues of rust-sdl2 - which also requires a lifetime bound for textures (unless you use the None of the examples for either library are complex enough to reveal how painful this can be when you don't want to stuff all of your initialization logic into Edit: Though after further contemplation - it seems this isn't so bad when you wrap the window in an |
Yes, I agree that the docs should make it more obvious that to avoid lifetime headaches you should just wrap your window in an |
Hey @mkrasnitski, |
This seems to supersede my PR at #386 . I'm not quite sure what we're waiting on for this PR now, can someone explain? |
This PR is currently blocked on |
I would be in support of any effort to upstream some of the unblocking work. |
Would it make sense to drop imgui example (temporarily) and not block this PR ? Once imgui catch up, the example can be added back, in the meantime imgui user can use the existing old version |
I believe that is probably the right compromise. Both My proposal would be updating the imgui example to use the previous release version, with a comment somewhere about the transitive dependency issue. |
As if on cue, |
I've updated |
From what I can tell, supporting |
Yeah, upgrading They plan to remove the existing event hander callback and replace it with a bucket of callbacks defined in a trait: rust-windowing/winit#3626. Somehow digging deeper into Inversion of Control territory is appealing to the maintainers. I'm keen to stick with 0.29 for now, but I'll be planning on a general replacement since they insist on making app and game development more difficult than it should be. |
Is there a way to use this with only winit and game-loop? I don't care about imgui, egui, or fltk. It is frustrating to wait so long to update when the release is held up by features that don't affect me. |
Certainly - just point at my fork. Compatibility with dependencies you aren't using won't matter for you so you'll be able to use the lib fine. |
@mkrasnitski Thank you! |
I tend to agree that there is an underlying issue here. The core library can be upgraded, it is merely the surrounding example integrations that consistently keep this project out of date. @parasyte it might be worth considering moving complex examples to pinned versions of the library, or moving them into a separate repository? |
6493408
to
76a76a8
Compare
Ok I'm fed up waiting for imgui-wgpu-rs to update support for wgpu, so the solution is to just pin the example to use a specific Btw @parasyte it might be worth it to cut release 0.13.1 off the current project HEAD and publish it so that the imgui example can point to |
Sorry for the ping @parasyte, do you have any additional concerns, or is this PR free to merge? |
My apologies for dropping the ball on this! I've had my attention focused elsewhere. Just about to publish a new version from |
Removed menu as it's no longer supported directly by `tao`.
Lock game-loop to 1.1.0 - version 1.2.0 bumps `winit` to 0.30 which we don't support yet
Until `imgui-wgpu-rs` updates support for `wgpu`, pin the example to an old `pixels` commit.
76a76a8
to
ca04c5d
Compare
I recognize how much effort this was, and how important the updates are. All of the checks are green, so I'm comfortable merging without hesitation. Any other needs can be addressed in smaller PRs. Thank you for everything you did here, @mkrasnitski! |
Also bumps
raw-window-handle
to 0.6. Blocked on the following:imgui
releaseimgui-wgpu-rs
: Update wgpu to 0.19 Yatekii/imgui-wgpu-rs#107egui
releasefltk
release: Supportraw-window-handle
0.6 fltk-rs/fltk-rs#1512game-loop
: fix(deps)!: update winit to 0.29 tuzz/game-loop#21Right now this PR uses these libraries are used as git dependencies. I point at my own fork of
imgui-wgpu-rs
for now.