Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
236 changes: 132 additions & 104 deletions Cargo.lock

Large diffs are not rendered by default.

22 changes: 13 additions & 9 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,11 @@ homepage = "https://gpui-ce.github.io/"
readme = "README.md"

[workspace.dependencies]
accesskit = { version = "0.24.0", features = ["enumn"] }
accesskit_consumer = "0.38.0"
accesskit_macos = "0.26.0"
accesskit_unix = "0.22.0"
accesskit_windows = "0.33.1"
accesskit = { version = "0.25.1", features = ["enumn"] }
accesskit_consumer = "0.39.1"
accesskit_macos = "0.27.1"
accesskit_unix = "0.24.0"
accesskit_windows = "0.35.1"
anyhow = "1.0.86"
async-task = "4.7"
backtrace = "0.3"
Expand Down Expand Up @@ -187,10 +187,14 @@ ashpd = { version = "0.13", default-features = false, features = [
libc = "0.2"
smol = "2.0"
util = { path = "crates/gpui_zed_util", version = "0.2.2", package = "gpui_ce_zed_util" }
wgpu = "29.0.3"
wgsl-rs = { git = "https://github.com/schell/wgsl-rs", rev = "b2de16a1b81e67d76bc265c296184f882864badb", default-features = false, features = [
"validation",
] }
wgpu = "30.0.1"
# No `validation` here: it only backs the `#[cfg(test)]` validation tests the
# `#[wgsl]` macro generates, and it links wgsl-rs's own naga (29, behind this
# workspace's), so enabling it workspace-wide put a second naga into every
# consumer's normal build. gpui_render, the one crate with `#[wgsl]` modules,
# enables it as a dev-dependency instead, and its build.rs already validates
# every pipeline's WGSL with this workspace's naga on every build.
wgsl-rs = { git = "https://github.com/schell/wgsl-rs", rev = "b2de16a1b81e67d76bc265c296184f882864badb", default-features = false }
criterion = { version = "0.5", features = ["html_reports"] }
objc2-app-kit = { version = "0.3", default-features = false, features = [
"objc2-core-foundation",
Expand Down
2 changes: 1 addition & 1 deletion crates/gpui/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1543,7 +1543,7 @@ impl Window {
}
let initial_tree = accesskit::TreeUpdate {
nodes: vec![(ROOT_NODE_ID, initial_root_node)],
tree: Some(accesskit::Tree::new(ROOT_NODE_ID)),
tree: Some(accesskit::TreeInfo::new(ROOT_NODE_ID)),
tree_id: accesskit::TreeId::ROOT,
focus: ROOT_NODE_ID,
};
Expand Down
2 changes: 1 addition & 1 deletion crates/gpui/src/window/a11y.rs
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@ impl A11yNodeBuilder {
let nodes = std::mem::take(&mut self.all_nodes);
let update = TreeUpdate {
nodes,
tree: Some(accesskit::Tree::new(ROOT_NODE_ID)),
tree: Some(accesskit::TreeInfo::new(ROOT_NODE_ID)),
tree_id: accesskit::TreeId::ROOT,
focus,
};
Expand Down
8 changes: 6 additions & 2 deletions crates/gpui_render/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ wgsl-rs.workspace = true
windows.workspace = true

[build-dependencies]
naga = { version = "29.0.4", features = [
naga = { version = "30.0.1", features = [
"glsl-out",
"hlsl-out",
"msl-out",
Expand All @@ -34,4 +34,8 @@ gpui = { path = "../gpui", version = "0.2.2", package = "gpui-ce", default-featu
wgsl-rs.workspace = true

[dev-dependencies]
naga = { version = "29.0.4", features = ["wgsl-in"] }
naga = { version = "30.0.1", features = ["wgsl-in"] }
# The `#[wgsl]` modules' generated `#[cfg(test)]` validation tests call
# `Source::validate`, which only exists with this feature. Enabling it here
# keeps those tests while leaving wgsl-rs's own naga out of normal builds.
wgsl-rs = { workspace = true, features = ["validation"] }
9 changes: 8 additions & 1 deletion crates/gpui_render/src/shaders/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,14 @@ use super::*;
#[test]
fn validates_subpixel_shader() {
let generated = subpixel_sprite::WGSL_SOURCE.wgsl_source().unwrap();
wgsl_rs::validate_wgsl_source(&format!("enable dual_source_blending;\n{generated}")).unwrap();
let source = format!("enable dual_source_blending;\n{generated}");
let module = naga::front::wgsl::parse_str(&source).unwrap();
naga::valid::Validator::new(
naga::valid::ValidationFlags::all(),
naga::valid::Capabilities::all(),
)
.validate(&module)
.unwrap();
}

#[test]
Expand Down
2 changes: 1 addition & 1 deletion crates/gpui_wgpu/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ bytemuck = { version = "1", features = ["derive"] }
criterion.workspace = true
env_logger.workspace = true
gpui_platform = { workspace = true, features = ["font-kit", "wayland", "x11"] }
naga = { version = "29.0.4", features = ["wgsl-in"] }
naga = { version = "30.0.1", features = ["wgsl-in"] }

[[example]]
name = "custom_gpu"
Expand Down
1 change: 1 addition & 0 deletions crates/gpui_wgpu/src/wgpu_atlas.rs
Original file line number Diff line number Diff line change
Expand Up @@ -439,6 +439,7 @@ mod tests {
power_preference: wgpu::PowerPreference::LowPower,
compatible_surface: None,
force_fallback_adapter: false,
apply_limit_buckets: false,
})
.await
.map_err(|error| anyhow::anyhow!("failed to request adapter: {error}"))?;
Expand Down
3 changes: 3 additions & 0 deletions crates/gpui_wgpu/src/wgpu_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,7 @@ impl WgpuContext {
power_preference: wgpu::PowerPreference::LowPower,
compatible_surface: None,
force_fallback_adapter: false,
apply_limit_buckets: false,
}))
.map_err(|error| {
anyhow::anyhow!("failed to request headless GPU adapter: {error}")
Expand Down Expand Up @@ -580,6 +581,7 @@ impl WgpuContext {
power_preference: wgpu::PowerPreference::HighPerformance,
compatible_surface: Some(&surface),
force_fallback_adapter: false,
apply_limit_buckets: false,
})
.await
.map_err(|error| {
Expand Down Expand Up @@ -881,6 +883,7 @@ impl WgpuContext {
desired_maximum_frame_latency: 2,
alpha_mode: caps.alpha_modes[0],
view_formats: vec![],
color_space: wgpu::SurfaceColorSpace::Auto,
};

surface.configure(&device.device, &test_config);
Expand Down
2 changes: 1 addition & 1 deletion crates/gpui_wgpu/src/wgpu_renderer/platform.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ impl WgpuRenderer {
.create_view(&wgpu::TextureViewDescriptor::default());
let rendered = self.render_to_view(scene, &view);
if rendered {
frame.present();
self.resources().queue.present(frame);
}
rendered
}
Expand Down
3 changes: 3 additions & 0 deletions crates/gpui_wgpu/src/wgpu_renderer/surfaces/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,7 @@ unsafe fn import_core_video_texture(
1,
1,
size.into(),
None,
)
};
Some(unsafe {
Expand All @@ -229,6 +230,8 @@ unsafe fn import_core_video_texture(
usage: wgpu::TextureUsages::TEXTURE_BINDING,
view_formats: &[],
},
// What wgpu 29 always assumed for a wrapped texture.
wgpu::TextureUses::UNINITIALIZED,
)
})
}
3 changes: 3 additions & 0 deletions crates/gpui_wgpu/src/wgpu_renderer/target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,9 @@ impl RenderTarget {
desired_maximum_frame_latency: 2,
alpha_mode,
view_formats: Vec::new(),
// `Auto` is wgpu's pre-30 behavior: sRGB, or extended linear
// sRGB for an Rgba16Float surface.
color_space: wgpu::SurfaceColorSpace::Auto,
},
transparent_alpha_mode,
opaque_alpha_mode,
Expand Down
Loading