Skip to content

Lifetimes, surface creation, and multi-threaded rendering using winit and wgpu. #6284

Answered by bwoods
chaueve asked this question in Q&A
Discussion options

You must be logged in to vote

Are you passing a clone() of the Arc<Window> directly into instance.create_surface?

Here is what I am doing:

    pub async fn new(window: Arc<Window>) -> Self {
        let (width, height) = window.inner_size().into();
        let scale = window.scale_factor() as f32;

        let instance = wgpu::Instance::default();
        let surface = instance.create_surface(window).unwrap();

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
2 replies
@chaueve
Comment options

@cwfitzgerald
Comment options

Comment options

You must be logged in to vote
2 replies
@chaueve
Comment options

@chaueve
Comment options

Answer selected by chaueve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants