//! Quick test to verify wgpu API compatibility

#[tokio::main]
async fn main() {
    println!("Testing wgpu API compatibility...");

    // Test 1: Create instance
    let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
        backends: wgpu::Backends::all(),
        flags: wgpu::InstanceFlags::default(),
        memory_budget_thresholds: Default::default(),
        backend_options: Default::default(),
        display: None,
    });
    println!("✅ Instance created");

    // Test 2: Enumerate adapters
    let adapters: Vec<_> = instance.enumerate_adapters(wgpu::Backends::all()).await;
    println!("✅ Found {} adapters", adapters.len());

    if let Some(adapter) = adapters.first() {
        let info = adapter.get_info();
        println!("   First adapter: {} ({:?})", info.name, info.device_type);

        // Test 3: Request device
        match adapter
            .request_device(&wgpu::DeviceDescriptor {
                label: Some("Test Device"),
                required_features: wgpu::Features::empty(),
                required_limits: wgpu::Limits::default(),
                experimental_features: wgpu::ExperimentalFeatures::disabled(),
                memory_hints: wgpu::MemoryHints::default(),
                trace: wgpu::Trace::Off,
            })
            .await
        {
            Ok((device, queue)) => {
                println!("✅ Device and queue created");
                println!("   Device features: {:?}", device.features());
                println!("   Queue: {:?}", std::ptr::addr_of!(queue));
            }
            Err(e) => {
                println!("⚠️  Device creation failed: {}", e);
            }
        }
    } else {
        println!("❌ No adapters found");
    }
}
