create_instance

Function create_instance 

Source
pub async fn create_instance(
    label: &str,
    primary_window: Option<&RawHandleWrapperHolder>,
) -> RenderInstanceData<'static>
Expand description

Create a new GPU instance (device + queue) and optionally bind to a window surface.

primary_window must expose a native handle; on Bevy it is provided via RawHandleWrapperHolder.

ยงExample

use bevy::window::RawHandleWrapperHolder;
use wde_wgpu::instance::create_instance;

let render = create_instance("demo", Some(&window)).await;
assert!(render.data.read().unwrap().surface.is_some());