mirror of
https://github.com/emilk/egui.git
synced 2026-08-29 04:40:03 -04:00
Update wgpu to 28.0.0 (#7853)
Co-authored-by: lucasmerlin <hi@lucasmerlin.me>
This commit is contained in:
committed by
GitHub
parent
5031c47cb2
commit
41b8f5f4e7
@@ -268,6 +268,7 @@ impl WebPainter for WebPainterWgpu {
|
||||
label: Some("egui_render"),
|
||||
occlusion_query_set: None,
|
||||
timestamp_writes: None,
|
||||
multiview_mask: None,
|
||||
});
|
||||
|
||||
// Forgetting the pass' lifetime means that we are no longer compile-time protected from
|
||||
@@ -280,15 +281,13 @@ impl WebPainter for WebPainterWgpu {
|
||||
);
|
||||
}
|
||||
|
||||
let mut capture_buffer = None;
|
||||
|
||||
if capture && let Some(capture_state) = &mut self.screen_capture_state {
|
||||
capture_buffer = Some(capture_state.copy_textures(
|
||||
&render_state.device,
|
||||
&output_frame,
|
||||
&mut encoder,
|
||||
));
|
||||
}
|
||||
let capture_buffer = if capture
|
||||
&& let Some(capture_state) = &mut self.screen_capture_state
|
||||
{
|
||||
Some(capture_state.copy_textures(&render_state.device, &output_frame, &mut encoder))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
Some((output_frame, capture_buffer))
|
||||
};
|
||||
|
||||
@@ -47,7 +47,7 @@ impl CaptureState {
|
||||
},
|
||||
depth_stencil: None,
|
||||
multisample: MultisampleState::default(),
|
||||
multiview: None,
|
||||
multiview_mask: None,
|
||||
cache: None,
|
||||
});
|
||||
|
||||
@@ -165,6 +165,7 @@ impl CaptureState {
|
||||
depth_stencil_attachment: None,
|
||||
occlusion_query_set: None,
|
||||
timestamp_writes: None,
|
||||
multiview_mask: None,
|
||||
});
|
||||
|
||||
pass.set_pipeline(&self.pipeline);
|
||||
|
||||
@@ -185,7 +185,7 @@ impl RenderState {
|
||||
wgpu::Backends::all()
|
||||
};
|
||||
|
||||
instance.enumerate_adapters(backends)
|
||||
instance.enumerate_adapters(backends).await
|
||||
};
|
||||
|
||||
let (adapter, device, queue) = match config.wgpu_setup.clone() {
|
||||
@@ -395,6 +395,10 @@ pub fn adapter_info_summary(info: &wgpu::AdapterInfo) -> String {
|
||||
driver,
|
||||
driver_info,
|
||||
backend,
|
||||
device_pci_bus_id,
|
||||
subgroup_min_size,
|
||||
subgroup_max_size,
|
||||
transient_saves_memory,
|
||||
} = &info;
|
||||
|
||||
// Example values:
|
||||
@@ -426,6 +430,13 @@ pub fn adapter_info_summary(info: &wgpu::AdapterInfo) -> String {
|
||||
if *device != 0 {
|
||||
summary += &format!(", device: 0x{device:02X}");
|
||||
}
|
||||
if !device_pci_bus_id.is_empty() {
|
||||
summary += &format!(", pci_bus_id: {device_pci_bus_id:?}");
|
||||
}
|
||||
if *subgroup_min_size != 0 || *subgroup_max_size != 0 {
|
||||
summary += &format!(", subgroup_size: {subgroup_min_size}..={subgroup_max_size}");
|
||||
}
|
||||
summary += &format!(", transient_saves_memory: {transient_saves_memory}");
|
||||
|
||||
summary
|
||||
}
|
||||
|
||||
@@ -353,7 +353,7 @@ impl Renderer {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("egui_pipeline_layout"),
|
||||
bind_group_layouts: &[&uniform_bind_group_layout, &texture_bind_group_layout],
|
||||
push_constant_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let depth_stencil = options
|
||||
@@ -426,7 +426,7 @@ impl Renderer {
|
||||
})],
|
||||
compilation_options: wgpu::PipelineCompilationOptions::default()
|
||||
}),
|
||||
multiview: None,
|
||||
multiview_mask: None,
|
||||
cache: None,
|
||||
}
|
||||
)
|
||||
|
||||
@@ -362,14 +362,13 @@ impl Painter {
|
||||
#[cfg(all(target_os = "macos", feature = "macos-window-resize-jitter-fix"))]
|
||||
{
|
||||
// SAFETY: The cast is checked with if condition. If the used backend is not metal
|
||||
// it gracefully fails. The pointer casts are valid as it's 1-to-1 type mapping.
|
||||
// This is how wgpu currently exposes this backend-specific flag.
|
||||
// it gracefully fails.
|
||||
unsafe {
|
||||
if let Some(hal_surface) = state.surface.as_hal::<wgpu::hal::api::Metal>() {
|
||||
let raw =
|
||||
std::ptr::from_ref::<wgpu::hal::metal::Surface>(&*hal_surface).cast_mut();
|
||||
|
||||
(*raw).present_with_transaction = resizing;
|
||||
hal_surface
|
||||
.render_layer()
|
||||
.lock()
|
||||
.set_presents_with_transaction(resizing);
|
||||
|
||||
Self::configure_surface(
|
||||
state,
|
||||
@@ -582,6 +581,7 @@ impl Painter {
|
||||
}),
|
||||
timestamp_writes: None,
|
||||
occlusion_query_set: None,
|
||||
multiview_mask: None,
|
||||
});
|
||||
|
||||
// Forgetting the pass' lifetime means that we are no longer compile-time protected from
|
||||
|
||||
@@ -41,7 +41,7 @@ impl Custom3d {
|
||||
let pipeline_layout = device.create_pipeline_layout(&wgpu::PipelineLayoutDescriptor {
|
||||
label: Some("custom3d"),
|
||||
bind_group_layouts: &[&bind_group_layout],
|
||||
push_constant_ranges: &[],
|
||||
immediate_size: 0,
|
||||
});
|
||||
|
||||
let pipeline = device.create_render_pipeline(&wgpu::RenderPipelineDescriptor {
|
||||
@@ -62,7 +62,7 @@ impl Custom3d {
|
||||
primitive: wgpu::PrimitiveState::default(),
|
||||
depth_stencil: None,
|
||||
multisample: wgpu::MultisampleState::default(),
|
||||
multiview: None,
|
||||
multiview_mask: None,
|
||||
cache: None,
|
||||
});
|
||||
|
||||
|
||||
@@ -219,6 +219,10 @@ fn integration_ui(ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
|
||||
driver,
|
||||
driver_info,
|
||||
backend,
|
||||
device_pci_bus_id,
|
||||
subgroup_min_size,
|
||||
subgroup_max_size,
|
||||
transient_saves_memory,
|
||||
} = &info;
|
||||
|
||||
// Example values:
|
||||
@@ -261,6 +265,19 @@ fn integration_ui(ui: &mut egui::Ui, _frame: &mut eframe::Frame) {
|
||||
ui.label(format!("0x{device:02X}"));
|
||||
ui.end_row();
|
||||
}
|
||||
if !device_pci_bus_id.is_empty() {
|
||||
ui.label("PCI Bus ID:");
|
||||
ui.label(device_pci_bus_id.as_str());
|
||||
ui.end_row();
|
||||
}
|
||||
if *subgroup_min_size != 0 || *subgroup_max_size != 0 {
|
||||
ui.label("Subgroup size:");
|
||||
ui.label(format!("{subgroup_min_size}..={subgroup_max_size}"));
|
||||
ui.end_row();
|
||||
}
|
||||
ui.label("Transient saves memory:");
|
||||
ui.label(format!("{transient_saves_memory}"));
|
||||
ui.end_row();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user