-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Don't panic when wgpu swapchain frame is outdated #667
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
Changes from 2 commits
4e39101
1c06920
e822f65
1912887
a7d2834
e5010b8
b629a80
3e03a42
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,9 @@ pub trait Compositor: Sized { | |
|
||
/// Draws the output primitives to the next frame of the given [`SwapChain`]. | ||
/// | ||
/// This will return an error if drawing could not be completed on this frame. | ||
/// If an error occurs, try calling this again on the next frame. | ||
/// | ||
/// [`SwapChain`]: Self::SwapChain | ||
fn draw<T: AsRef<str>>( | ||
&mut self, | ||
|
@@ -49,5 +52,5 @@ pub trait Compositor: Sized { | |
background_color: Color, | ||
output: &<Self::Renderer as iced_native::Renderer>::Output, | ||
overlay: &[T], | ||
) -> mouse::Interaction; | ||
) -> Result<mouse::Interaction, ()>; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think a proper error type here would make sense, maybe just copy There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe? I think that the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, yeah that could work. I've made those changes. |
||
} |
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.
Can we handle the other errors? I think the only error that makes sense to panic is
OutOfMemory
.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.
Yeah, this makes sense.