pub async fn initialize_renderer(
    instance: &Instance,
    request_adapter_options: &RequestAdapterOptions<'_>,
    device_descriptor: &DeviceDescriptor<'_>,
) -> (RenderDevice, RenderQueue) {
    let adapter = instance
        .request_adapter(request_adapter_options)
        .await
        .expect("Unable to find a GPU! Make sure you have installed required drivers!");

    info!("{:?}", adapter.get_info());

    #[cfg(feature = "wgpu_trace")]
    let trace_path = {
        let path = std::path::Path::new("wgpu_trace");
        // ignore potential error, wgpu will log it
        let _ = std::fs::create_dir(path);
        Some(path)
    };
    #[cfg(not(feature = "wgpu_trace"))]
    let trace_path = None;

    let (device, queue) = adapter
        .request_device(device_descriptor, trace_path)
        .await
        .unwrap();
    let device = Arc::new(device);
    let queue = Arc::new(queue);
    (RenderDevice::from(device), queue)
}
/// Initializes the renderer by retrieving and preparing the GPU instance, device and queue
/// for the specified backend.
Initializes the renderer by retrieving and preparing the GPU instance, device and queue
for the specified backend.
Initializes the renderer by retrieving and preparing the GPU instance device and queue for the specified backend .
pub async fn initialize_renderer(
    instance: &Instance,
    request_adapter_options: &RequestAdapterOptions<'_>,
    device_descriptor: &DeviceDescriptor<'_>,
) -> (RenderDevice, RenderQueue) {
    let adapter = instance
        .request_adapter(request_adapter_options)
        .await
        .expect("Unable to find a GPU! Make sure you have installed required drivers!");
    info!("{:?}", adapter.get_info());
    #[cfg(feature = "wgpu_trace")]
    let trace_path = {
        let path = std::path::Path::new("wgpu_trace");
        // ignore potential error, wgpu will log it
        let _ = std::fs::create_dir(path);
        Some(path)
    };
    #[cfg(not(feature = "wgpu_trace"))]
    let trace_path = None;
    let (device, queue) = adapter
        .request_device(device_descriptor, trace_path)
        .await
        .unwrap();
    let device = Arc::new(device);
    let queue = Arc::new(queue);
    (RenderDevice::from(device), queue)
}
pub async fn initialize_renderer ( instance : & Instance , request_adapter_options : & RequestAdapterOptions < ' _ > , device_descriptor : & DeviceDescriptor < ' _ > , ) -> ( RenderDevice , RenderQueue ) { let adapter = instance . request_adapter ( request_adapter_options ) . await . expect ( " " ) ; info ! ( " " adapter get_info ( ) ) ; # [ cfg ( feature " " ) ] let trace_path = { let path = std :: path :: Path :: new ( " " ) ; // ignore potential error, wgpu will log it let _ = std :: fs :: create_dir ( path ) ; Some ( path ) } ; # [ cfg ( not ( feature " " ) ) ] let trace_path = None ; let ( device , queue ) = adapter . request_device ( device_descriptor , trace_path ) . await . unwrap ( ) ; let device = Arc :: new ( device ) ; let queue = Arc :: new ( queue ) ; ( RenderDevice :: from ( device ) , queue ) }
Initializes the renderer by retrieving and preparing the GPU instance, device and queue
for the specified backend.
Initializes the renderer by retrieving and preparing the GPU instance device and queue for the specified backend .
instance
&Instance
request_adapter_options
&RequestAdapterOptions<'_>
device_descriptor
&DeviceDescriptor<'_>
instance
&Instance
request_adapter_options
&RequestAdapterOptions<'_>
device_descriptor
&DeviceDescriptor<'_>