mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 23:08:05 +08:00
Update CEF
This commit is contained in:
@@ -49,7 +49,7 @@ impl ContextBuilder {
|
||||
}
|
||||
pub async fn available_adapters_fmt(&self) -> impl std::fmt::Display {
|
||||
let instance = self.build_instance();
|
||||
fmt::AvailableAdaptersFormatter(instance.enumerate_adapters(self.backends))
|
||||
fmt::AvailableAdaptersFormatter(instance.enumerate_adapters(self.backends).await)
|
||||
}
|
||||
}
|
||||
#[cfg(target_family = "wasm")]
|
||||
@@ -102,9 +102,9 @@ impl ContextBuilder {
|
||||
let instance = self.build_instance();
|
||||
|
||||
let selected_adapter = if let Some(select) = select {
|
||||
self.select_adapter(&instance, select)
|
||||
self.select_adapter(&instance, select).await
|
||||
} else if cfg!(target_os = "windows") {
|
||||
self.select_adapter(&instance, |adapters: &[Adapter]| adapters.iter().position(|a| a.get_info().backend == wgpu::Backend::Dx12))
|
||||
self.select_adapter(&instance, |adapters: &[Adapter]| adapters.iter().position(|a| a.get_info().backend == wgpu::Backend::Dx12)).await
|
||||
} else {
|
||||
None
|
||||
};
|
||||
@@ -119,11 +119,11 @@ impl ContextBuilder {
|
||||
instance: Arc::new(instance),
|
||||
})
|
||||
}
|
||||
fn select_adapter<S>(&self, instance: &Instance, select: S) -> Option<Adapter>
|
||||
async fn select_adapter<S>(&self, instance: &Instance, select: S) -> Option<Adapter>
|
||||
where
|
||||
S: Fn(&[Adapter]) -> Option<usize>,
|
||||
{
|
||||
let mut adapters = instance.enumerate_adapters(self.backends);
|
||||
let mut adapters = instance.enumerate_adapters(self.backends).await;
|
||||
let selected_index = select(&adapters)?;
|
||||
if selected_index >= adapters.len() {
|
||||
return None;
|
||||
|
||||
@@ -39,7 +39,7 @@ impl Resampler {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("resample_pipeline_layout"),
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
push_constant_ranges: &[],
|
||||
..Default::default()
|
||||
});
|
||||
|
||||
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
@@ -67,7 +67,7 @@ impl Resampler {
|
||||
},
|
||||
depth_stencil: None,
|
||||
multisample: wgpu::MultisampleState::default(),
|
||||
multiview: None,
|
||||
multiview_mask: None,
|
||||
cache: None,
|
||||
});
|
||||
|
||||
@@ -135,9 +135,7 @@ impl Resampler {
|
||||
},
|
||||
depth_slice: None,
|
||||
})],
|
||||
depth_stencil_attachment: None,
|
||||
timestamp_writes: None,
|
||||
occlusion_query_set: None,
|
||||
..Default::default()
|
||||
});
|
||||
|
||||
render_pass.set_pipeline(&self.pipeline);
|
||||
|
||||
@@ -117,7 +117,7 @@ impl PerPixelAdjustGraphicsPipeline {
|
||||
label: Some(&format!("PerPixelAdjust {name} BindGroupLayout 0")),
|
||||
entries,
|
||||
})],
|
||||
push_constant_ranges: &[],
|
||||
..Default::default()
|
||||
});
|
||||
|
||||
let pipeline = device.create_render_pipeline(&RenderPipelineDescriptor {
|
||||
@@ -140,6 +140,7 @@ impl PerPixelAdjustGraphicsPipeline {
|
||||
},
|
||||
depth_stencil: None,
|
||||
multisample: Default::default(),
|
||||
multiview_mask: None,
|
||||
fragment: Some(FragmentState {
|
||||
module: &shader_module,
|
||||
entry_point: Some(&fragment_name),
|
||||
@@ -150,7 +151,6 @@ impl PerPixelAdjustGraphicsPipeline {
|
||||
write_mask: Default::default(),
|
||||
})],
|
||||
}),
|
||||
multiview: None,
|
||||
cache: None,
|
||||
});
|
||||
Self {
|
||||
@@ -227,9 +227,7 @@ impl PerPixelAdjustGraphicsPipeline {
|
||||
},
|
||||
depth_slice: None,
|
||||
})],
|
||||
depth_stencil_attachment: None,
|
||||
timestamp_writes: None,
|
||||
occlusion_query_set: None,
|
||||
..Default::default()
|
||||
});
|
||||
rp.set_pipeline(&self.pipeline);
|
||||
rp.set_bind_group(0, Some(&bind_group), &[]);
|
||||
|
||||
Reference in New Issue
Block a user