deps: wgpu -> 0.15
This might help with https://github.com/wez/wezterm/issues/3032
This commit is contained in:
5 files changed
+108
-38
No files matched your search
Generated
+79
-24
@@ -492,12 +492,6 @@ version = "1.0.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
|
||||
|
||||
[[package]]
|
||||
name = "cfg_aliases"
|
||||
version = "0.1.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e"
|
||||
|
||||
[[package]]
|
||||
name = "cgl"
|
||||
version = "0.3.2"
|
||||
@@ -705,6 +699,12 @@ dependencies = [
|
||||
"csscolorparser",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "com-rs"
|
||||
version = "0.2.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "bf43edc576402991846b093a7ca18a3477e0ef9c588cde84964b5d3e43016642"
|
||||
|
||||
[[package]]
|
||||
name = "concurrent-queue"
|
||||
version = "2.1.0"
|
||||
@@ -1051,9 +1051,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "d3d12"
|
||||
version = "0.5.0"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "827914e1f53b1e0e025ecd3d967a7836b7bcb54520f90e21ef8df7b4d88a2759"
|
||||
checksum = "d8f0de2f5a8e7bd4a9eec0e3c781992a4ce1724f68aec7d7a3715344de8b39da"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"libloading 0.7.4",
|
||||
@@ -1842,9 +1842,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "glow"
|
||||
version = "0.11.2"
|
||||
version = "0.12.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d8bd5877156a19b8ac83a29b2306fe20537429d318f3ff0a1a2119f8d9c61919"
|
||||
checksum = "8edf6019dff2d92ad27c1e3ff82ad50a0aea5b01370353cc928bfdc33e95925c"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"slotmap",
|
||||
@@ -1888,6 +1888,19 @@ dependencies = [
|
||||
"bitflags",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gpu-allocator"
|
||||
version = "0.21.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "434618454f74b63f9b39328298097256977c41ea0ba9d75a47238b77790b6163"
|
||||
dependencies = [
|
||||
"backtrace",
|
||||
"log",
|
||||
"thiserror",
|
||||
"winapi",
|
||||
"windows 0.43.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "gpu-descriptor"
|
||||
version = "0.2.3"
|
||||
@@ -1987,6 +2000,21 @@ dependencies = [
|
||||
"hashbrown 0.11.2",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hassle-rs"
|
||||
version = "0.9.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "90601c6189668c7345fc53842cb3f3a3d872203d523be1b3cb44a36a3e62fb85"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"com-rs",
|
||||
"libc",
|
||||
"libloading 0.7.4",
|
||||
"thiserror",
|
||||
"widestring",
|
||||
"winapi",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hdrhistogram"
|
||||
version = "7.5.2"
|
||||
@@ -2944,9 +2972,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "naga"
|
||||
version = "0.10.0"
|
||||
version = "0.11.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "262d2840e72dbe250e8cf2f522d080988dfca624c4112c096238a4845f591707"
|
||||
checksum = "5eafe22a23b797c9bc227c6c896419b26b5bb88fa903417a3adaed08778850d5"
|
||||
dependencies = [
|
||||
"bit-set",
|
||||
"bitflags",
|
||||
@@ -5955,7 +5983,7 @@ dependencies = [
|
||||
"winapi",
|
||||
"window",
|
||||
"window-funcs",
|
||||
"windows",
|
||||
"windows 0.33.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6099,7 +6127,7 @@ dependencies = [
|
||||
"objc",
|
||||
"open",
|
||||
"serde",
|
||||
"windows",
|
||||
"windows 0.33.0",
|
||||
"xml-rs",
|
||||
"zbus",
|
||||
"zvariant",
|
||||
@@ -6107,15 +6135,17 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wgpu"
|
||||
version = "0.14.2"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "81f643110d228fd62a60c5ed2ab56c4d5b3704520bd50561174ec4ec74932937"
|
||||
checksum = "d14c6bfcf3b10f4273f522a95994553c0a5f2934976e62e61a720ae4bc2eb8f2"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"cfg-if",
|
||||
"js-sys",
|
||||
"log",
|
||||
"naga",
|
||||
"parking_lot 0.12.1",
|
||||
"profiling",
|
||||
"raw-window-handle",
|
||||
"smallvec",
|
||||
"static_assertions",
|
||||
@@ -6129,14 +6159,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wgpu-core"
|
||||
version = "0.14.2"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "6000d1284ef8eec6076fd5544a73125fd7eb9b635f18dceeb829d826f41724ca"
|
||||
checksum = "be1f61be28e557a6ecb2506cac06c63fae3b6d302a006f38195a7a80995abeb9"
|
||||
dependencies = [
|
||||
"arrayvec",
|
||||
"bit-vec",
|
||||
"bitflags",
|
||||
"cfg_aliases",
|
||||
"codespan-reporting",
|
||||
"fxhash",
|
||||
"log",
|
||||
@@ -6153,9 +6182,9 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wgpu-hal"
|
||||
version = "0.14.1"
|
||||
version = "0.15.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "3cc320a61acb26be4f549c9b1b53405c10a223fbfea363ec39474c32c348d12f"
|
||||
checksum = "82e95792925fe3d58950b9a5c2a191caa145e2bc570e2d233f0d7320f6a8e814"
|
||||
dependencies = [
|
||||
"android_system_properties",
|
||||
"arrayvec",
|
||||
@@ -6169,9 +6198,12 @@ dependencies = [
|
||||
"fxhash",
|
||||
"glow",
|
||||
"gpu-alloc",
|
||||
"gpu-allocator",
|
||||
"gpu-descriptor",
|
||||
"hassle-rs",
|
||||
"js-sys",
|
||||
"khronos-egl",
|
||||
"libc",
|
||||
"libloading 0.7.4",
|
||||
"log",
|
||||
"metal",
|
||||
@@ -6192,11 +6224,13 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "wgpu-types"
|
||||
version = "0.14.1"
|
||||
version = "0.15.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "fb6b28ef22cac17b9109b25b3bf8c9a103eeb293d7c5f78653979b09140375f6"
|
||||
checksum = "ecf8cfcbf98f94cc8bd5981544c687140cf9d3948e2ab83849367ead2cd737cf"
|
||||
dependencies = [
|
||||
"bitflags",
|
||||
"js-sys",
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -6209,6 +6243,12 @@ dependencies = [
|
||||
"web-sys",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "widestring"
|
||||
version = "0.5.1"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "17882f045410753661207383517a6f62ec3dbeb6a4ed2acce01f0728238d1983"
|
||||
|
||||
[[package]]
|
||||
name = "winapi"
|
||||
version = "0.3.9"
|
||||
@@ -6293,7 +6333,7 @@ dependencies = [
|
||||
"wezterm-font",
|
||||
"wezterm-input-types",
|
||||
"winapi",
|
||||
"windows",
|
||||
"windows 0.33.0",
|
||||
"winreg",
|
||||
"x11",
|
||||
"xcb",
|
||||
@@ -6327,6 +6367,21 @@ dependencies = [
|
||||
"windows_x86_64_msvc 0.33.0",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows"
|
||||
version = "0.43.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "04662ed0e3e5630dfa9b26e4cb823b817f1a9addda855d973a9458c236556244"
|
||||
dependencies = [
|
||||
"windows_aarch64_gnullvm",
|
||||
"windows_aarch64_msvc 0.42.1",
|
||||
"windows_i686_gnu 0.42.1",
|
||||
"windows_i686_msvc 0.42.1",
|
||||
"windows_x86_64_gnu 0.42.1",
|
||||
"windows_x86_64_gnullvm",
|
||||
"windows_x86_64_msvc 0.42.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "windows-sys"
|
||||
version = "0.42.0"
|
||||
|
||||
@@ -101,7 +101,7 @@ wezterm-mux-server-impl = { path = "../wezterm-mux-server-impl" }
|
||||
wezterm-ssh = { path = "../wezterm-ssh" }
|
||||
wezterm-term = { path = "../term", features=["use_serde"] }
|
||||
wezterm-toast-notification = { path = "../wezterm-toast-notification" }
|
||||
wgpu = "0.14"
|
||||
wgpu = "0.15"
|
||||
window = { path = "../window" }
|
||||
window-funcs = { path = "../lua-api-crates/window-funcs" }
|
||||
|
||||
|
||||
@@ -82,7 +82,10 @@ pub fn register(lua: &Lua) -> anyhow::Result<()> {
|
||||
"enumerate_gpus",
|
||||
lua.create_function(|_, _: ()| {
|
||||
let backends = wgpu::Backends::all();
|
||||
let instance = wgpu::Instance::new(backends);
|
||||
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
|
||||
backends,
|
||||
..Default::default()
|
||||
});
|
||||
let gpus: Vec<GpuInfo> = instance
|
||||
.enumerate_adapters(backends)
|
||||
.map(|adapter| {
|
||||
|
||||
@@ -19,21 +19,21 @@ struct VertexOutput {
|
||||
};
|
||||
|
||||
// a regular monochrome text glyph
|
||||
let IS_GLYPH: f32 = 0.0;
|
||||
const IS_GLYPH: f32 = 0.0;
|
||||
|
||||
// a color emoji glyph
|
||||
let IS_COLOR_EMOJI: f32 = 1.0;
|
||||
const IS_COLOR_EMOJI: f32 = 1.0;
|
||||
|
||||
// a full color texture attached as the
|
||||
// background image of the window
|
||||
let IS_BG_IMAGE: f32 = 2.0;
|
||||
const IS_BG_IMAGE: f32 = 2.0;
|
||||
|
||||
// like 2.0, except that instead of an
|
||||
// image, we use the solid bg color
|
||||
let IS_SOLID_COLOR: f32 = 3.0;
|
||||
const IS_SOLID_COLOR: f32 = 3.0;
|
||||
|
||||
// Grayscale poly quad for non-aa text render layers
|
||||
let IS_GRAY_SCALE: f32 = 4.0;
|
||||
const IS_GRAY_SCALE: f32 = 4.0;
|
||||
|
||||
struct ShaderUniform {
|
||||
foreground_text_hsb: vec3<f32>,
|
||||
|
||||
@@ -120,6 +120,7 @@ impl Texture2d for WebGpuTexture {
|
||||
|
||||
impl WebGpuTexture {
|
||||
pub fn new(width: u32, height: u32, state: &WebGpuState) -> Self {
|
||||
let format = wgpu::TextureFormat::Rgba8UnormSrgb;
|
||||
let texture = state.device.create_texture(&wgpu::TextureDescriptor {
|
||||
size: wgpu::Extent3d {
|
||||
width,
|
||||
@@ -129,9 +130,10 @@ impl WebGpuTexture {
|
||||
mip_level_count: 1,
|
||||
sample_count: 1,
|
||||
dimension: wgpu::TextureDimension::D2,
|
||||
format: wgpu::TextureFormat::Rgba8UnormSrgb,
|
||||
format,
|
||||
usage: wgpu::TextureUsages::TEXTURE_BINDING | wgpu::TextureUsages::COPY_DST,
|
||||
label: Some("Texture Atlas"),
|
||||
view_formats: &[format, format.remove_srgb_suffix()],
|
||||
});
|
||||
Self {
|
||||
texture,
|
||||
@@ -197,8 +199,11 @@ impl WebGpuState {
|
||||
config: &ConfigHandle,
|
||||
) -> anyhow::Result<Self> {
|
||||
let backends = wgpu::Backends::all();
|
||||
let instance = wgpu::Instance::new(backends);
|
||||
let surface = unsafe { instance.create_surface(&handle) };
|
||||
let instance = wgpu::Instance::new(wgpu::InstanceDescriptor {
|
||||
backends,
|
||||
..Default::default()
|
||||
});
|
||||
let surface = unsafe { instance.create_surface(&handle)? };
|
||||
|
||||
let mut adapter: Option<wgpu::Adapter> = None;
|
||||
|
||||
@@ -280,8 +285,8 @@ impl WebGpuState {
|
||||
|
||||
let adapter_info = adapter.get_info();
|
||||
log::trace!("Using adapter: {adapter_info:?}");
|
||||
let alpha_modes = surface.get_supported_alpha_modes(&adapter);
|
||||
log::trace!("alpha modes: {alpha_modes:?}");
|
||||
let caps = surface.get_capabilities(&adapter);
|
||||
log::trace!("caps: {caps:?}");
|
||||
|
||||
let (device, queue) = adapter
|
||||
.request_device(
|
||||
@@ -302,17 +307,24 @@ impl WebGpuState {
|
||||
|
||||
let queue = Arc::new(queue);
|
||||
|
||||
// Explicitly request an SRGB format, if available
|
||||
let format = caps.formats[0].add_srgb_suffix();
|
||||
|
||||
let config = wgpu::SurfaceConfiguration {
|
||||
usage: wgpu::TextureUsages::RENDER_ATTACHMENT,
|
||||
format: surface.get_supported_formats(&adapter)[0],
|
||||
format,
|
||||
width: dimensions.pixel_width as u32,
|
||||
height: dimensions.pixel_height as u32,
|
||||
present_mode: wgpu::PresentMode::Fifo,
|
||||
alpha_mode: if alpha_modes.contains(&wgpu::CompositeAlphaMode::PostMultiplied) {
|
||||
alpha_mode: if caps
|
||||
.alpha_modes
|
||||
.contains(&wgpu::CompositeAlphaMode::PostMultiplied)
|
||||
{
|
||||
wgpu::CompositeAlphaMode::PostMultiplied
|
||||
} else {
|
||||
wgpu::CompositeAlphaMode::Auto
|
||||
},
|
||||
view_formats: vec![format, format.remove_srgb_suffix()],
|
||||
};
|
||||
surface.configure(&device, &config);
|
||||
|
||||
|
||||
Reference in new issue
Block a user