From 2f422e97dd8fdee1232dc2fce24cafdeae104979 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Thu, 2 Jan 2025 22:06:45 -0800 Subject: [PATCH] replace enumerate_adapters with request_adapter --- strafe-client/src/setup.rs | 28 +++++----------------------- 1 file changed, 5 insertions(+), 23 deletions(-) diff --git a/strafe-client/src/setup.rs b/strafe-client/src/setup.rs index 790352d..a836473 100644 --- a/strafe-client/src/setup.rs +++ b/strafe-client/src/setup.rs @@ -68,29 +68,11 @@ impl<'a> SetupContextPartial2<'a>{ //let optional_features=optional_features(); let required_features=required_features(); - //no helper function smh gotta write it myself - let adapters=self.instance.enumerate_adapters(self.backends); - - let mut chosen_adapter=None; - let mut chosen_adapter_score=0; - for adapter in adapters { - if !adapter.is_surface_supported(&self.surface) { - continue; - } - - let score=match adapter.get_info().device_type{ - wgpu::DeviceType::IntegratedGpu=>3, - wgpu::DeviceType::DiscreteGpu=>4, - wgpu::DeviceType::VirtualGpu=>2, - wgpu::DeviceType::Other|wgpu::DeviceType::Cpu=>1, - }; - - let adapter_features=adapter.features(); - if chosen_adapter_score