From 012569845dae90e99f6e52192e6eb196de98424f Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Wed, 13 Jan 2021 02:31:40 -0500 Subject: [PATCH 1/3] Update render pass and framebuffers logic to the latest gfx-hal --- Cargo.lock | 25 ++-- Cargo.toml | 4 +- wgpu-core/Cargo.toml | 20 +-- wgpu-core/src/command/mod.rs | 4 +- wgpu-core/src/command/render.rs | 214 ++++++++++++++------------------ wgpu-core/src/device/life.rs | 70 +---------- wgpu-core/src/device/mod.rs | 53 +++++--- wgpu-core/src/device/queue.rs | 8 +- wgpu-core/src/resource.rs | 2 + wgpu-core/src/swap_chain.rs | 11 +- 10 files changed, 166 insertions(+), 245 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 3535581b68..98263098c2 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -441,7 +441,7 @@ dependencies = [ [[package]] name = "gfx-auxil" version = "0.5.0" -source = "git+https://github.com/gfx-rs/gfx?rev=6b3a1e36939473f0062232baf11e1deacd6605f4#6b3a1e36939473f0062232baf11e1deacd6605f4" +source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" dependencies = [ "fxhash", "gfx-hal", @@ -451,7 +451,7 @@ dependencies = [ [[package]] name = "gfx-backend-dx11" version = "0.6.0" -source = "git+https://github.com/gfx-rs/gfx?rev=6b3a1e36939473f0062232baf11e1deacd6605f4#6b3a1e36939473f0062232baf11e1deacd6605f4" +source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" dependencies = [ "arrayvec", "bitflags", @@ -472,7 +472,7 @@ dependencies = [ [[package]] name = "gfx-backend-dx12" version = "0.6.2" -source = "git+https://github.com/gfx-rs/gfx?rev=6b3a1e36939473f0062232baf11e1deacd6605f4#6b3a1e36939473f0062232baf11e1deacd6605f4" +source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" dependencies = [ "arrayvec", "bit-set", @@ -492,7 +492,7 @@ dependencies = [ [[package]] name = "gfx-backend-empty" version = "0.6.0" -source = "git+https://github.com/gfx-rs/gfx?rev=6b3a1e36939473f0062232baf11e1deacd6605f4#6b3a1e36939473f0062232baf11e1deacd6605f4" +source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" dependencies = [ "gfx-hal", "log", @@ -502,7 +502,7 @@ dependencies = [ [[package]] name = "gfx-backend-gl" version = "0.6.0" -source = "git+https://github.com/gfx-rs/gfx?rev=6b3a1e36939473f0062232baf11e1deacd6605f4#6b3a1e36939473f0062232baf11e1deacd6605f4" +source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" dependencies = [ "arrayvec", "bitflags", @@ -525,7 +525,7 @@ dependencies = [ [[package]] name = "gfx-backend-metal" version = "0.6.0" -source = "git+https://github.com/gfx-rs/gfx?rev=6b3a1e36939473f0062232baf11e1deacd6605f4#6b3a1e36939473f0062232baf11e1deacd6605f4" +source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" dependencies = [ "arrayvec", "bitflags", @@ -535,7 +535,6 @@ dependencies = [ "foreign-types", "gfx-auxil", "gfx-hal", - "lazy_static", "log", "metal", "naga", @@ -550,7 +549,7 @@ dependencies = [ [[package]] name = "gfx-backend-vulkan" version = "0.6.5" -source = "git+https://github.com/gfx-rs/gfx?rev=6b3a1e36939473f0062232baf11e1deacd6605f4#6b3a1e36939473f0062232baf11e1deacd6605f4" +source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" dependencies = [ "arrayvec", "ash", @@ -558,10 +557,10 @@ dependencies = [ "core-graphics-types", "gfx-hal", "inplace_it", - "lazy_static", "log", "naga", "objc", + "parking_lot 0.11.0", "raw-window-handle", "smallvec", "winapi 0.3.9", @@ -570,7 +569,7 @@ dependencies = [ [[package]] name = "gfx-hal" version = "0.6.0" -source = "git+https://github.com/gfx-rs/gfx?rev=6b3a1e36939473f0062232baf11e1deacd6605f4#6b3a1e36939473f0062232baf11e1deacd6605f4" +source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" dependencies = [ "bitflags", "naga", @@ -580,9 +579,9 @@ dependencies = [ [[package]] name = "glow" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1625b792e2f9267116dd41eb7d325e0ea2572ceba5069451906745e04f852f33" +checksum = "3eac04632dc8c047fb70d658f8479583e1bb084859f67a150227769a10fc161f" dependencies = [ "js-sys", "slotmap", @@ -1209,7 +1208,7 @@ dependencies = [ [[package]] name = "range-alloc" version = "0.1.1" -source = "git+https://github.com/gfx-rs/gfx?rev=6b3a1e36939473f0062232baf11e1deacd6605f4#6b3a1e36939473f0062232baf11e1deacd6605f4" +source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" [[package]] name = "raw-window-handle" diff --git a/Cargo.toml b/Cargo.toml index ba911fe772..d329d430a8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ members = [ "wgpu-types", ] -#[patch."https://github.com/gfx-rs/gfx"] +[patch."https://github.com/gfx-rs/gfx"] #hal = { package = "gfx-hal", path = "../gfx/src/hal" } #gfx-backend-vulkan = { path = "../gfx/src/backend/vulkan", features = ["naga"] } #gfx-backend-metal = { path = "../gfx/src/backend/metal", features = ["naga"] } @@ -15,5 +15,5 @@ members = [ #gfx-backend-dx11 = { path = "../gfx/src/backend/dx11" } #gfx-backend-empty = { path = "../gfx/src/backend/empty" } -#[patch."https://github.com/gfx-rs/naga"] +[patch."https://github.com/gfx-rs/naga"] #naga = { path = "../naga" } diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index ce0a960c38..1c7e305448 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -36,24 +36,24 @@ thiserror = "1" gpu-alloc = { git = "https://github.com/zakarumych/gpu-alloc", rev = "29e761f24edc50e28d238e723503b146d55d222e", features = ["tracing"] } gpu-descriptor = { git = "https://github.com/zakarumych/gpu-descriptor", rev = "df74fd8c7bea03149058a41aab0e4fe04077b266", features = ["tracing"] } -hal = { package = "gfx-hal", git = "https://github.com/gfx-rs/gfx", rev = "6b3a1e36939473f0062232baf11e1deacd6605f4" } -gfx-backend-empty = { git = "https://github.com/gfx-rs/gfx", rev = "6b3a1e36939473f0062232baf11e1deacd6605f4" } +hal = { package = "gfx-hal", git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997" } +gfx-backend-empty = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997" } [target.'cfg(all(not(target_arch = "wasm32"), all(unix, not(target_os = "ios"), not(target_os = "macos"))))'.dependencies] -gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "6b3a1e36939473f0062232baf11e1deacd6605f4", features = ["naga"] } -gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "6b3a1e36939473f0062232baf11e1deacd6605f4", features = ["naga"] } +gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997", features = ["naga"] } +gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997", features = ["naga"] } [target.'cfg(all(not(target_arch = "wasm32"), any(target_os = "ios", target_os = "macos")))'.dependencies] -gfx-backend-metal = { git = "https://github.com/gfx-rs/gfx", rev = "6b3a1e36939473f0062232baf11e1deacd6605f4", features = ["naga"] } -gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "6b3a1e36939473f0062232baf11e1deacd6605f4", optional = true } +gfx-backend-metal = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997", features = ["naga"] } +gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997", optional = true } [target.'cfg(all(not(target_arch = "wasm32"), windows))'.dependencies] -gfx-backend-dx12 = { git = "https://github.com/gfx-rs/gfx", rev = "6b3a1e36939473f0062232baf11e1deacd6605f4" } -gfx-backend-dx11 = { git = "https://github.com/gfx-rs/gfx", rev = "6b3a1e36939473f0062232baf11e1deacd6605f4" } -gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "6b3a1e36939473f0062232baf11e1deacd6605f4", features = ["naga"] } +gfx-backend-dx12 = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997" } +gfx-backend-dx11 = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997" } +gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997", features = ["naga"] } [target.'cfg(target_arch = "wasm32")'.dependencies] -gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "6b3a1e36939473f0062232baf11e1deacd6605f4", features = ["naga"] } +gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997", features = ["naga"] } [dependencies.naga] git = "https://github.com/gfx-rs/naga" diff --git a/wgpu-core/src/command/mod.rs b/wgpu-core/src/command/mod.rs index b9cfbde0cf..6a19f9378b 100644 --- a/wgpu-core/src/command/mod.rs +++ b/wgpu-core/src/command/mod.rs @@ -43,7 +43,7 @@ pub struct CommandBuffer { recorded_thread_id: ThreadId, pub(crate) device_id: Stored, pub(crate) trackers: TrackerSet, - pub(crate) used_swap_chains: SmallVec<[(Stored, B::Framebuffer); 1]>, + pub(crate) used_swap_chains: SmallVec<[Stored; 1]>, limits: wgt::Limits, private_features: PrivateFeatures, has_labels: bool, @@ -217,7 +217,7 @@ impl Global { Ok(cmd_buf) => { cmd_buf.is_recording = false; // stop tracking the swapchain image, if used - for (ref sc_id, _) in cmd_buf.used_swap_chains.iter() { + for sc_id in cmd_buf.used_swap_chains.iter() { let view_id = swap_chain_guard[sc_id.value] .acquired_view_id .as_ref() diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 88f55599d4..262147a24c 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -11,8 +11,8 @@ use crate::{ }, conv, device::{ - AttachmentData, AttachmentDataVec, Device, FramebufferKey, RenderPassCompatibilityError, - RenderPassContext, RenderPassKey, MAX_COLOR_TARGETS, MAX_VERTEX_BUFFERS, + AttachmentData, AttachmentDataVec, Device, RenderPassCompatibilityError, RenderPassContext, + RenderPassKey, RenderPassLock, MAX_COLOR_TARGETS, MAX_VERTEX_BUFFERS, }, hub::{GfxBackend, Global, GlobalIdentityHandlerFactory, Storage, Token}, id, @@ -42,6 +42,7 @@ use std::{ borrow::{Borrow, Cow}, collections::hash_map::Entry, fmt, iter, + marker::PhantomData, num::NonZeroU32, ops::Range, str, @@ -503,15 +504,14 @@ struct RenderAttachment<'a> { new_use: TextureUse, } -type UsedSwapChainInfo = Option<(Stored, F)>; - struct RenderPassInfo<'a, B: hal::Backend> { context: RenderPassContext, trackers: TrackerSet, render_attachments: AttachmentDataVec>, - used_swapchain_with_framebuffer: UsedSwapChainInfo, + used_swap_chain: Option>, is_ds_read_only: bool, extent: wgt::Extent3d, + _phantom: PhantomData, } impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { @@ -543,7 +543,6 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { let mut depth_stencil_aspects = hal::format::Aspects::empty(); let mut used_swap_chain = None::>; let mut trackers = TrackerSet::new(B::VARIANT); - let mut used_swapchain_with_framebuffer = None; let mut add_view = |view: &TextureView| { if let Some(ex) = extent { @@ -809,8 +808,11 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { return Err(RenderPassErrorInner::InvalidSampleCount(sample_count)); } - let mut render_pass_cache = device.render_passes.lock(); - let render_pass = match render_pass_cache.entry(rp_key.clone()) { + let RenderPassLock { + ref mut render_passes, + ref mut framebuffers, + } = *device.render_passes.lock(); + let render_pass = match render_passes.entry(rp_key.clone()) { Entry::Occupied(e) => e.into_mut(), Entry::Vacant(entry) => { let color_ids: [hal::pass::AttachmentRef; MAX_COLOR_TARGETS] = [ @@ -871,82 +873,40 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { } }; - let mut framebuffer_cache; - let fb_key = FramebufferKey { + let view_data = AttachmentData { colors: color_attachments .iter() - .map(|at| id::Valid(at.attachment)) + .map(|at| view_guard.get(at.attachment).unwrap()) .collect(), resolves: color_attachments .iter() .filter_map(|at| at.resolve_target) - .map(id::Valid) + .map(|attachment| view_guard.get(attachment).unwrap()) .collect(), - depth_stencil: depth_stencil_attachment.map(|at| id::Valid(at.attachment)), + depth_stencil: depth_stencil_attachment + .map(|at| view_guard.get(at.attachment).unwrap()), }; + let fb_key = view_data.map(|view| view.framebuffer_attachment.clone()); let context = RenderPassContext { - attachments: AttachmentData { - colors: fb_key - .colors - .iter() - .map(|&at| view_guard[at].format) - .collect(), - resolves: fb_key - .resolves - .iter() - .map(|&at| view_guard[at].format) - .collect(), - depth_stencil: fb_key.depth_stencil.map(|at| view_guard[at].format), - }, + attachments: view_data.map(|view| view.format), sample_count, }; - let framebuffer = match used_swap_chain.take() { - Some(sc_id) => { - // Always create a new framebuffer and delete it after presentation. - let attachments = fb_key - .all() - .map(|&id| match view_guard[id].inner { - TextureViewInner::Native { ref raw, .. } => raw, - TextureViewInner::SwapChain { ref image, .. } => Borrow::borrow(image), - }) - .collect::>(); - let framebuffer = unsafe { + // Cache framebuffers by the device. + let framebuffer = match framebuffers.entry(fb_key) { + Entry::Occupied(e) => e.into_mut(), + Entry::Vacant(e) => { + let fb = unsafe { device .raw - .create_framebuffer(&render_pass, attachments, extent.unwrap()) + .create_framebuffer( + &render_pass, + e.key().all().map(|fat| fat.clone()), + extent.unwrap(), + ) .or(Err(RenderPassErrorInner::OutOfMemory))? }; - used_swapchain_with_framebuffer = Some((sc_id, framebuffer)); - &mut used_swapchain_with_framebuffer.as_mut().unwrap().1 - } - None => { - // Cache framebuffers by the device. - framebuffer_cache = device.framebuffers.lock(); - match framebuffer_cache.entry(fb_key) { - Entry::Occupied(e) => e.into_mut(), - Entry::Vacant(e) => { - let fb = { - let attachments = e - .key() - .all() - .map(|&id| match view_guard[id].inner { - TextureViewInner::Native { ref raw, .. } => raw, - TextureViewInner::SwapChain { ref image, .. } => { - Borrow::borrow(image) - } - }) - .collect::>(); - unsafe { - device - .raw - .create_framebuffer(&render_pass, attachments, extent.unwrap()) - .or(Err(RenderPassErrorInner::OutOfMemory))? - } - }; - e.insert(fb) - } - } + e.insert(fb) } }; @@ -959,59 +919,75 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { h: ex.height as _, } }; + let raw_views = view_data.map(|view| match view.inner { + TextureViewInner::Native { ref raw, .. } => raw, + TextureViewInner::SwapChain { ref image, .. } => Borrow::borrow(image), + }); - let clear_values = color_attachments + let attachments = color_attachments .iter() .zip(&rp_key.colors) - .flat_map(|(at, (rat, _layout))| { - match at.channel.load_op { - LoadOp::Load => None, - LoadOp::Clear => { - use hal::format::ChannelType; - //TODO: validate sign/unsign and normalized ranges of the color values - let value = match rat.format.unwrap().base_format().1 { - ChannelType::Unorm - | ChannelType::Snorm - | ChannelType::Ufloat - | ChannelType::Sfloat - | ChannelType::Uscaled - | ChannelType::Sscaled - | ChannelType::Srgb => hal::command::ClearColor { - float32: conv::map_color_f32(&at.channel.clear_value), - }, - ChannelType::Sint => hal::command::ClearColor { - sint32: conv::map_color_i32(&at.channel.clear_value), - }, - ChannelType::Uint => hal::command::ClearColor { - uint32: conv::map_color_u32(&at.channel.clear_value), - }, - }; - Some(hal::command::ClearValue { color: value }) - } - } - }) - .chain(depth_stencil_attachment.and_then(|at| { - match (at.depth.load_op, at.stencil.load_op) { - (LoadOp::Load, LoadOp::Load) => None, - (LoadOp::Clear, _) | (_, LoadOp::Clear) => { - let value = hal::command::ClearDepthStencil { - depth: at.depth.clear_value, - stencil: at.stencil.clear_value, - }; - Some(hal::command::ClearValue { - depth_stencil: value, - }) - } + .zip(raw_views.colors) + .map( + |((at, (rat, _layout)), image_view)| hal::command::RenderAttachmentInfo { + image_view, + clear_value: match at.channel.load_op { + LoadOp::Load => Default::default(), + LoadOp::Clear => { + use hal::format::ChannelType; + //TODO: validate sign/unsign and normalized ranges of the color values + let value = match rat.format.unwrap().base_format().1 { + ChannelType::Unorm + | ChannelType::Snorm + | ChannelType::Ufloat + | ChannelType::Sfloat + | ChannelType::Uscaled + | ChannelType::Sscaled + | ChannelType::Srgb => hal::command::ClearColor { + float32: conv::map_color_f32(&at.channel.clear_value), + }, + ChannelType::Sint => hal::command::ClearColor { + sint32: conv::map_color_i32(&at.channel.clear_value), + }, + ChannelType::Uint => hal::command::ClearColor { + uint32: conv::map_color_u32(&at.channel.clear_value), + }, + }; + hal::command::ClearValue { color: value } + } + }, + }, + ) + .chain(raw_views.resolves.into_iter().map(|image_view| { + hal::command::RenderAttachmentInfo { + image_view, + clear_value: Default::default(), } })) - .collect::>(); + .chain(depth_stencil_attachment.zip(raw_views.depth_stencil).map( + |(at, image_view)| hal::command::RenderAttachmentInfo { + image_view, + clear_value: match (at.depth.load_op, at.stencil.load_op) { + (LoadOp::Load, LoadOp::Load) => Default::default(), + (LoadOp::Clear, _) | (_, LoadOp::Clear) => { + let value = hal::command::ClearDepthStencil { + depth: at.depth.clear_value, + stencil: at.stencil.clear_value, + }; + hal::command::ClearValue { + depth_stencil: value, + } + } + }, + }, + )); unsafe { raw.begin_render_pass( render_pass, framebuffer, rect, - clear_values, + attachments, hal::command::SubpassContents::Inline, ); raw.set_scissors(0, iter::once(&rect)); @@ -1028,20 +1004,21 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { context, trackers, render_attachments, - used_swapchain_with_framebuffer, + used_swap_chain, is_ds_read_only, extent: wgt::Extent3d { width: attachment_width.ok_or(RenderPassErrorInner::MissingAttachments)?, height: attachment_height.ok_or(RenderPassErrorInner::MissingAttachments)?, depth: 1, }, + _phantom: PhantomData, }) } fn finish( mut self, texture_guard: &Storage, id::TextureId>, - ) -> Result<(TrackerSet, UsedSwapChainInfo), RenderPassErrorInner> { + ) -> Result<(TrackerSet, Option>), RenderPassErrorInner> { for ra in self.render_attachments { let texture = &texture_guard[ra.texture_id.value]; check_texture_usage(texture.usage, TextureUsage::RENDER_ATTACHMENT)?; @@ -1072,7 +1049,7 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { .unwrap(); } } - Ok((self.trackers, self.used_swapchain_with_framebuffer)) + Ok((self.trackers, self.used_swap_chain)) } } @@ -1108,7 +1085,7 @@ impl Global { let (device_guard, mut token) = hub.devices.read(&mut token); - let (cmd_buf_raw, trackers, used_swapchain_with_framebuffer) = { + let (cmd_buf_raw, trackers, used_swapchain) = { // read-only lock guard let (cmb_guard, mut token) = hub.command_buffers.read(&mut token); @@ -1866,9 +1843,8 @@ impl Global { raw.end_render_pass(); } - let (trackers, used_swapchain_with_framebuffer) = - info.finish(&*texture_guard).map_pass_err(scope)?; - (raw, trackers, used_swapchain_with_framebuffer) + let (trackers, used_swapchain) = info.finish(&*texture_guard).map_pass_err(scope)?; + (raw, trackers, used_swapchain) }; let (mut cmb_guard, mut token) = hub.command_buffers.write(&mut token); @@ -1877,9 +1853,7 @@ impl Global { let cmd_buf = CommandBuffer::get_encoder_mut(&mut *cmb_guard, encoder_id).map_pass_err(scope)?; cmd_buf.has_labels |= base.label.is_some(); - cmd_buf - .used_swap_chains - .extend(used_swapchain_with_framebuffer); + cmd_buf.used_swap_chains.extend(used_swapchain); #[cfg(feature = "trace")] if let Some(ref mut list) = cmd_buf.commands { diff --git a/wgpu-core/src/device/life.rs b/wgpu-core/src/device/life.rs index 015ebeb4d8..594ea4edae 100644 --- a/wgpu-core/src/device/life.rs +++ b/wgpu-core/src/device/life.rs @@ -14,7 +14,7 @@ use crate::{ hub::{GfxBackend, GlobalIdentityHandlerFactory, Hub, Token}, id, resource, track::TrackerSet, - FastHashMap, RefCount, Stored, SubmissionIndex, + RefCount, Stored, SubmissionIndex, }; use copyless::VecHelper as _; @@ -636,74 +636,6 @@ impl LifetimeTracker { } } - pub(crate) fn triage_framebuffers( - &mut self, - hub: &Hub, - framebuffers: &mut FastHashMap, - token: &mut Token>, - ) { - let (texture_view_guard, _) = hub.texture_views.read(token); - let remove_list = framebuffers - .keys() - .filter_map(|key| { - let mut last_submit = None; - let mut needs_cleanup = false; - - // A framebuffer needs to be scheduled for cleanup, if there's at least one - // attachment is no longer valid. - - for &at in key.all() { - // If this attachment is still registered, it's still valid - if texture_view_guard.contains(at.0) { - continue; - } - - // This attachment is no longer registered, this framebuffer needs cleanup - needs_cleanup = true; - - // Check if there's any active submissions that are still referring to this - // attachment, if there are we need to get the greatest submission index, as - // that's the last time this attachment is still valid - let mut attachment_last_submit = None; - for a in &self.active { - if a.last_resources.image_views.iter().any(|&(id, _)| id == at) { - let max = attachment_last_submit.unwrap_or(0).max(a.index); - attachment_last_submit = Some(max); - } - } - - // Between all attachments, we need the smallest index, because that's the last - // time this framebuffer is still valid - if let Some(attachment_last_submit) = attachment_last_submit { - let min = last_submit - .unwrap_or(std::usize::MAX) - .min(attachment_last_submit); - last_submit = Some(min); - } - } - - if needs_cleanup { - Some((key.clone(), last_submit.unwrap_or(0))) - } else { - None - } - }) - .collect::>(); - - if !remove_list.is_empty() { - tracing::debug!("Free framebuffers {:?}", remove_list); - for (ref key, submit_index) in remove_list { - let framebuffer = framebuffers.remove(key).unwrap(); - self.active - .iter_mut() - .find(|a| a.index == submit_index) - .map_or(&mut self.free_resources, |a| &mut a.last_resources) - .framebuffers - .push(framebuffer); - } - } - } - pub(crate) fn handle_mapping( &mut self, hub: &Hub, diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index 6ff7349405..7b977bfe63 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -103,12 +103,20 @@ impl AttachmentData { .chain(&self.resolves) .chain(&self.depth_stencil) } + + pub(crate) fn map U>(&self, fun: F) -> AttachmentData { + AttachmentData { + colors: self.colors.iter().map(&fun).collect(), + resolves: self.resolves.iter().map(&fun).collect(), + depth_stencil: self.depth_stencil.as_ref().map(&fun), + } + } } pub(crate) type AttachmentDataVec = ArrayVec<[T; MAX_COLOR_TARGETS + MAX_COLOR_TARGETS + 1]>; pub(crate) type RenderPassKey = AttachmentData<(hal::pass::Attachment, hal::image::Layout)>; -pub(crate) type FramebufferKey = AttachmentData>; +pub(crate) type FramebufferKey = AttachmentData; #[derive(Clone, Debug, Hash, PartialEq)] #[cfg_attr(feature = "serial-pass", derive(serde::Deserialize, serde::Serialize))] @@ -211,11 +219,17 @@ fn fire_map_callbacks>(callback } } +#[derive(Debug)] +pub(crate) struct RenderPassLock { + pub(crate) render_passes: FastHashMap, + pub(crate) framebuffers: FastHashMap, +} + /// Structure describing a logical device. Some members are internally mutable, /// stored behind mutexes. /// TODO: establish clear order of locking for these: /// `mem_allocator`, `desc_allocator`, `life_tracke`, `trackers`, -/// `render_passes`, `framebuffers`, `pending_writes`, `trace`. +/// `render_passes`, `pending_writes`, `trace`. /// /// Currently, the rules are: /// 1. `life_tracker` is locked after `hub.devices`, enforced by the type system @@ -234,8 +248,7 @@ pub struct Device { pub(crate) active_submission_index: SubmissionIndex, /// Has to be locked temporarily only (locked last) pub(crate) trackers: Mutex, - pub(crate) render_passes: Mutex>, - pub(crate) framebuffers: Mutex>, + pub(crate) render_passes: Mutex>, // Life tracker should be locked right after the device and before anything else. life_tracker: Mutex>, temp_suspected: life::SuspectedResources, @@ -297,8 +310,10 @@ impl Device { life_guard: LifeGuard::new(""), active_submission_index: 0, trackers: Mutex::new(TrackerSet::new(B::VARIANT)), - render_passes: Mutex::new(FastHashMap::default()), - framebuffers: Mutex::new(FastHashMap::default()), + render_passes: Mutex::new(RenderPassLock { + render_passes: FastHashMap::default(), + framebuffers: FastHashMap::default(), + }), life_tracker: Mutex::new(life::LifetimeTracker::new()), temp_suspected: life::SuspectedResources::default(), #[cfg(feature = "trace")] @@ -359,7 +374,6 @@ impl Device { token, ); life_tracker.triage_mapped(hub, token); - life_tracker.triage_framebuffers(hub, &mut *self.framebuffers.lock(), token); let last_done = life_tracker.triage_submissions(&self.raw, force_wait)?; let callbacks = life_tracker.handle_mapping(hub, &self.raw, &self.trackers, token); life_tracker.cleanup(&self.raw, &self.mem_allocator, &self.desc_allocator); @@ -591,12 +605,11 @@ impl Device { mip_level_count, )); } - let mut view_capabilities = hal::image::ViewCapabilities::empty(); - + let mut view_caps = hal::image::ViewCapabilities::empty(); // 2D textures with array layer counts that are multiples of 6 could be cubemaps // Following gpuweb/gpuweb#68 always add the hint in that case if desc.dimension == TextureDimension::D2 && desc.size.depth % 6 == 0 { - view_capabilities |= hal::image::ViewCapabilities::KIND_CUBE; + view_caps |= hal::image::ViewCapabilities::KIND_CUBE; }; // TODO: 2D arrays, cubemap arrays @@ -610,7 +623,7 @@ impl Device { format, hal::image::Tiling::Optimal, usage, - view_capabilities, + view_caps, ) .map_err(|err| match err { hal::image::CreationError::OutOfMemory(_) => DeviceError::OutOfMemory, @@ -642,6 +655,11 @@ impl Device { kind, format: desc.format, format_features, + framebuffer_attachment: hal::image::FramebufferAttachment { + usage, + format, + view_caps, + }, full_range: TextureSelector { levels: 0..desc.mip_level_count as hal::image::Level, layers: 0..kind.num_layers(), @@ -801,6 +819,7 @@ impl Device { format_features: texture.format_features, extent: texture.kind.extent().at_level(desc.base_mip_level as _), samples: texture.kind.num_samples(), + framebuffer_attachment: texture.framebuffer_attachment.clone(), selector, life_guard: LifeGuard::new(desc.label.borrow_or_default()), }) @@ -2172,7 +2191,7 @@ impl Device { .get(pipeline_layout_id) .map_err(|_| pipeline::CreateRenderPipelineError::InvalidLayout)?; - let mut render_pass_cache = self.render_passes.lock(); + let mut rp_lock = self.render_passes.lock(); let pipeline_desc = hal::pso::GraphicsPipelineDesc { label: desc.label.as_ref().map(AsRef::as_ref), primitive_assembler, @@ -2185,7 +2204,7 @@ impl Device { layout: &layout.raw, subpass: hal::pass::Subpass { index: 0, - main_pass: match render_pass_cache.entry(rp_key) { + main_pass: match rp_lock.render_passes.entry(rp_key) { Entry::Occupied(e) => e.into_mut(), Entry::Vacant(e) => { let pass = self @@ -2312,10 +2331,11 @@ impl Device { unsafe { desc_alloc.cleanup(&self.raw); mem_alloc.clear(&self.raw); - for (_, rp) in self.render_passes.lock().drain() { + let rps = self.render_passes.into_inner(); + for (_, rp) in rps.render_passes { self.raw.destroy_render_pass(rp); } - for (_, fbo) in self.framebuffers.lock().drain() { + for (_, fbo) in rps.framebuffers { self.raw.destroy_framebuffer(fbo); } } @@ -3987,6 +4007,7 @@ impl Global { } } validate_swap_chain_descriptor(&mut config, &caps)?; + let framebuffer_attachment = config.framebuffer_attachment(); unsafe { B::get_surface_mut(surface) @@ -4027,8 +4048,8 @@ impl Global { .create_semaphore() .or(Err(DeviceError::OutOfMemory))?, acquired_view_id: None, - acquired_framebuffers: Vec::new(), active_submission_index: 0, + framebuffer_attachment, }; swap_chain_guard.insert(sc_id, swap_chain); Ok(sc_id) diff --git a/wgpu-core/src/device/queue.rs b/wgpu-core/src/device/queue.rs index 208b4278a5..355caa9cf3 100644 --- a/wgpu-core/src/device/queue.rs +++ b/wgpu-core/src/device/queue.rs @@ -514,19 +514,17 @@ impl Global { )); } - for (sc_id, fbo) in cmdbuf.used_swap_chains.drain(..) { + for sc_id in cmdbuf.used_swap_chains.drain(..) { let sc = &mut swap_chain_guard[sc_id.value]; - sc.active_submission_index = submit_index; if sc.acquired_view_id.is_none() { return Err(QueueSubmitError::SwapChainOutputDropped); } - // For each swapchain, we only want to have at most 1 signaled semaphore. - if sc.acquired_framebuffers.is_empty() { + if sc.active_submission_index != submit_index { + sc.active_submission_index = submit_index; // Only add a signal if this is the first time for this swapchain // to be used in the submission. signal_swapchain_semaphores.push(sc_id.value); } - sc.acquired_framebuffers.push(fbo); } // optimize the tracked states diff --git a/wgpu-core/src/resource.rs b/wgpu-core/src/resource.rs index c4ecf7161f..de9f7a58f4 100644 --- a/wgpu-core/src/resource.rs +++ b/wgpu-core/src/resource.rs @@ -206,6 +206,7 @@ pub struct Texture { pub(crate) kind: hal::image::Kind, pub(crate) format: wgt::TextureFormat, pub(crate) format_features: wgt::TextureFormatFeatures, + pub(crate) framebuffer_attachment: hal::image::FramebufferAttachment, pub(crate) full_range: TextureSelector, pub(crate) life_guard: LifeGuard, } @@ -309,6 +310,7 @@ pub struct TextureView { pub(crate) format_features: wgt::TextureFormatFeatures, pub(crate) extent: hal::image::Extent, pub(crate) samples: hal::image::NumSamples, + pub(crate) framebuffer_attachment: hal::image::FramebufferAttachment, pub(crate) selector: TextureSelector, pub(crate) life_guard: LifeGuard, } diff --git a/wgpu-core/src/swap_chain.rs b/wgpu-core/src/swap_chain.rs index 58bfdee385..89532b9b32 100644 --- a/wgpu-core/src/swap_chain.rs +++ b/wgpu-core/src/swap_chain.rs @@ -44,7 +44,7 @@ use crate::{ LifeGuard, PrivateFeatures, Stored, SubmissionIndex, }; -use hal::{self, device::Device as _, queue::CommandQueue as _, window::PresentationSurface as _}; +use hal::{queue::CommandQueue as _, window::PresentationSurface as _}; use thiserror::Error; use wgt::{SwapChainDescriptor, SwapChainStatus}; @@ -59,8 +59,8 @@ pub struct SwapChain { pub(crate) num_frames: hal::window::SwapImageIndex, pub(crate) semaphore: B::Semaphore, pub(crate) acquired_view_id: Option>, - pub(crate) acquired_framebuffers: Vec, pub(crate) active_submission_index: SubmissionIndex, + pub(crate) framebuffer_attachment: hal::image::FramebufferAttachment, } impl crate::hub::Resource for SwapChain { @@ -194,6 +194,7 @@ impl Global { depth: 1, }, samples: 1, + framebuffer_attachment: sc.framebuffer_attachment.clone(), selector: TextureSelector { layers: 0..1, levels: 0..1, @@ -282,12 +283,6 @@ impl Global { tracing::debug!(trace = true, "Presented. End of Frame"); - for fbo in sc.acquired_framebuffers.drain(..) { - unsafe { - device.raw.destroy_framebuffer(fbo); - } - } - match result { Ok(None) => Ok(SwapChainStatus::Good), Ok(Some(_)) => Ok(SwapChainStatus::Suboptimal), From a4f897b5d78268cfab1250a24088415baf69dad1 Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Fri, 15 Jan 2021 00:51:23 -0500 Subject: [PATCH 2/3] Include the extent into the framebuffer map key --- wgpu-core/src/command/render.rs | 118 +++++++------------------------- wgpu-core/src/device/mod.rs | 12 +++- wgpu-core/src/resource.rs | 2 +- wgpu-core/src/swap_chain.rs | 2 +- 4 files changed, 38 insertions(+), 96 deletions(-) diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 262147a24c..f342cf6b8d 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -390,15 +390,10 @@ pub enum RenderPassErrorInner { InvalidAttachment(id::TextureViewId), #[error("necessary attachments are missing")] MissingAttachments, - #[error("color and/or depth attachments have differing sizes: a {mismatching_attachment_type_name} attachment of size {mismatching_dimensions:?} is not compatible with a {previous_attachment_type_name} attachment's size {previous_dimensions:?}", - )] + #[error("attachments have differing sizes: {previous:?} is followed by {mismatch:?}")] AttachmentsDimensionMismatch { - /// depth or color - previous_attachment_type_name: &'static str, - /// depth or color - mismatching_attachment_type_name: &'static str, - previous_dimensions: (u32, u32), - mismatching_dimensions: (u32, u32), + previous: (&'static str, wgt::Extent3d), + mismatch: (&'static str, wgt::Extent3d), }, #[error("attachment's sample count {0} is invalid")] InvalidSampleCount(u8), @@ -408,11 +403,6 @@ pub enum RenderPassErrorInner { InvalidResolveTargetSampleCount, #[error("not enough memory left")] OutOfMemory, - #[error("extent state {state_extent:?} must match extent from view {view_extent:?}")] - ExtentStateMismatch { - state_extent: hal::image::Extent, - view_extent: hal::image::Extent, - }, #[error("attempted to use a swap chain image as a depth/stencil attachment")] SwapChainImageAsDepthStencil, #[error("unable to clear non-present/read-only depth")] @@ -532,24 +522,19 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { let mut render_attachments = AttachmentDataVec::::new(); - let mut attachment_width = None; - let mut attachment_height = None; let mut attachment_type_name = ""; - - let mut mismatching_dimensions = None; - let mut extent = None; let mut sample_count = 0; let mut depth_stencil_aspects = hal::format::Aspects::empty(); let mut used_swap_chain = None::>; let mut trackers = TrackerSet::new(B::VARIANT); - let mut add_view = |view: &TextureView| { + let mut add_view = |view: &TextureView, type_name| { if let Some(ex) = extent { if ex != view.extent { - return Err(RenderPassErrorInner::ExtentStateMismatch { - state_extent: ex, - view_extent: view.extent, + return Err(RenderPassErrorInner::AttachmentsDimensionMismatch { + previous: (attachment_type_name, ex), + mismatch: (type_name, view.extent), }); } } else { @@ -563,6 +548,7 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { expected: sample_count, }); } + attachment_type_name = type_name; Ok(()) }; @@ -573,25 +559,7 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { .views .use_extend(&*view_guard, at.attachment, (), ()) .map_err(|_| RenderPassErrorInner::InvalidAttachment(at.attachment))?; - add_view(view)?; - - // get the width and height set by another attachment, then check if it matches - let (previous_width, previous_height) = ( - *attachment_width.get_or_insert(view.extent.width), - *attachment_height.get_or_insert(view.extent.height), - ); - - if previous_width != view.extent.width || previous_height != view.extent.height - { - mismatching_dimensions = Some(( - "depth", - (view.extent.width, view.extent.height), - (previous_width, previous_height), - )); - } else { - // this attachment's size was successfully inserted into `attachment_width` and `attachment_height` - attachment_type_name = "depth"; - } + add_view(view, "depth")?; depth_stencil_aspects = view.aspects; @@ -649,24 +617,7 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { .views .use_extend(&*view_guard, at.attachment, (), ()) .map_err(|_| RenderPassErrorInner::InvalidAttachment(at.attachment))?; - add_view(view)?; - - // get the width and height set by another attachment, then check if it matches - let (previous_width, previous_height) = ( - *attachment_width.get_or_insert(view.extent.width), - *attachment_height.get_or_insert(view.extent.height), - ); - - if previous_width != view.extent.width || previous_height != view.extent.height { - mismatching_dimensions = Some(( - "color", - (view.extent.width, view.extent.height), - (previous_width, previous_height), - )); - } else { - // this attachment's size was successfully inserted into `attachment_width` and `attachment_height` - attachment_type_name = "color"; - } + add_view(view, "color")?; let layouts = match view.inner { TextureViewInner::Native { ref source_id, .. } => { @@ -718,29 +669,15 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { colors.push((color_at, hal::image::Layout::ColorAttachmentOptimal)); } - if let Some(( - mismatching_attachment_type_name, - previous_dimensions, - mismatching_dimensions, - )) = mismatching_dimensions - { - return Err(RenderPassErrorInner::AttachmentsDimensionMismatch { - previous_attachment_type_name: attachment_type_name, - mismatching_attachment_type_name, - previous_dimensions, - mismatching_dimensions, - }); - } - for resolve_target in color_attachments.iter().flat_map(|at| at.resolve_target) { let view = trackers .views .use_extend(&*view_guard, resolve_target, (), ()) .map_err(|_| RenderPassErrorInner::InvalidAttachment(resolve_target))?; if extent != Some(view.extent) { - return Err(RenderPassErrorInner::ExtentStateMismatch { - state_extent: extent.unwrap_or_default(), - view_extent: view.extent, + return Err(RenderPassErrorInner::AttachmentsDimensionMismatch { + previous: (attachment_type_name, extent.unwrap_or_default()), + mismatch: ("resolve", view.extent), }); } if view.samples != 1 { @@ -886,7 +823,11 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { depth_stencil: depth_stencil_attachment .map(|at| view_guard.get(at.attachment).unwrap()), }; - let fb_key = view_data.map(|view| view.framebuffer_attachment.clone()); + let extent = extent.ok_or(RenderPassErrorInner::MissingAttachments)?; + let fb_key = ( + view_data.map(|view| view.framebuffer_attachment.clone()), + extent, + ); let context = RenderPassContext { attachments: view_data.map(|view| view.format), sample_count, @@ -901,8 +842,8 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { .raw .create_framebuffer( &render_pass, - e.key().all().map(|fat| fat.clone()), - extent.unwrap(), + e.key().0.all().map(|fat| fat.clone()), + conv::map_extent(&extent, wgt::TextureDimension::D3), ) .or(Err(RenderPassErrorInner::OutOfMemory))? }; @@ -910,14 +851,11 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { } }; - let rect = { - let ex = extent.unwrap(); - hal::pso::Rect { - x: 0, - y: 0, - w: ex.width as _, - h: ex.height as _, - } + let rect = hal::pso::Rect { + x: 0, + y: 0, + w: extent.width as _, + h: extent.height as _, }; let raw_views = view_data.map(|view| match view.inner { TextureViewInner::Native { ref raw, .. } => raw, @@ -1006,11 +944,7 @@ impl<'a, B: GfxBackend> RenderPassInfo<'a, B> { render_attachments, used_swap_chain, is_ds_read_only, - extent: wgt::Extent3d { - width: attachment_width.ok_or(RenderPassErrorInner::MissingAttachments)?, - height: attachment_height.ok_or(RenderPassErrorInner::MissingAttachments)?, - depth: 1, - }, + extent, _phantom: PhantomData, }) } diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index 7b977bfe63..a43f336acf 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -116,7 +116,10 @@ impl AttachmentData { pub(crate) type AttachmentDataVec = ArrayVec<[T; MAX_COLOR_TARGETS + MAX_COLOR_TARGETS + 1]>; pub(crate) type RenderPassKey = AttachmentData<(hal::pass::Attachment, hal::image::Layout)>; -pub(crate) type FramebufferKey = AttachmentData; +pub(crate) type FramebufferKey = ( + AttachmentData, + wgt::Extent3d, +); #[derive(Clone, Debug, Hash, PartialEq)] #[cfg_attr(feature = "serial-pass", derive(serde::Deserialize, serde::Serialize))] @@ -793,6 +796,7 @@ impl Device { layer_start: desc.base_array_layer as _, layer_count: desc.array_layer_count.map(|v| v.get() as _), }; + let hal_extent = texture.kind.extent().at_level(desc.base_mip_level as _); let raw = unsafe { self.raw @@ -817,7 +821,11 @@ impl Device { aspects, format: texture.format, format_features: texture.format_features, - extent: texture.kind.extent().at_level(desc.base_mip_level as _), + extent: wgt::Extent3d { + width: hal_extent.width, + height: hal_extent.height, + depth: view_layer_count, + }, samples: texture.kind.num_samples(), framebuffer_attachment: texture.framebuffer_attachment.clone(), selector, diff --git a/wgpu-core/src/resource.rs b/wgpu-core/src/resource.rs index de9f7a58f4..412a29cdb6 100644 --- a/wgpu-core/src/resource.rs +++ b/wgpu-core/src/resource.rs @@ -308,7 +308,7 @@ pub struct TextureView { pub(crate) aspects: hal::format::Aspects, pub(crate) format: wgt::TextureFormat, pub(crate) format_features: wgt::TextureFormatFeatures, - pub(crate) extent: hal::image::Extent, + pub(crate) extent: wgt::Extent3d, pub(crate) samples: hal::image::NumSamples, pub(crate) framebuffer_attachment: hal::image::FramebufferAttachment, pub(crate) selector: TextureSelector, diff --git a/wgpu-core/src/swap_chain.rs b/wgpu-core/src/swap_chain.rs index 89532b9b32..fcbfc7cbf1 100644 --- a/wgpu-core/src/swap_chain.rs +++ b/wgpu-core/src/swap_chain.rs @@ -188,7 +188,7 @@ impl Global { allowed_usages: wgt::TextureUsage::RENDER_ATTACHMENT, flags: wgt::TextureFormatFeatureFlags::empty(), }, - extent: hal::image::Extent { + extent: wgt::Extent3d { width: sc.desc.width, height: sc.desc.height, depth: 1, From 6c05470db0862cf62afa80b62b846f291e9d1e6e Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Fri, 15 Jan 2021 01:11:28 -0500 Subject: [PATCH 3/3] Minor dependencies bumps --- Cargo.lock | 532 +++++++++++++++++++++---------------------- player/Cargo.toml | 6 +- wgpu-core/Cargo.toml | 24 +- 3 files changed, 281 insertions(+), 281 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 98263098c2..425ff3c932 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,5 +1,11 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9fe5e32de01730eb1f6b7f5b51c17e03e2325bf40a74f754f04f130043affff" + [[package]] name = "ahash" version = "0.4.6" @@ -17,24 +23,17 @@ dependencies = [ [[package]] name = "andrew" -version = "0.2.1" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7f09f89872c2b6b29e319377b1fbe91c6f5947df19a25596e121cf19a7b35e" +checksum = "8c4afb09dd642feec8408e33f92f3ffc4052946f6b20f32fb99c1f58cd4fa7cf" dependencies = [ "bitflags", - "line_drawing", - "rusttype 0.7.9", + "rusttype", "walkdir", "xdg", "xml-rs", ] -[[package]] -name = "android_log-sys" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8052e2d8aabbb8d556d6abbcce2a22b9590996c5f849b9c7ce4544a2e3b984e" - [[package]] name = "ansi_term" version = "0.12.1" @@ -44,15 +43,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "approx" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0e60b75072ecd4168020818c0107f2857bb6c4e64252d8d3983f6263b40a5c3" -dependencies = [ - "num-traits", -] - [[package]] name = "arrayvec" version = "0.5.2" @@ -78,7 +68,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", - "libc 0.2.80", + "libc", "winapi 0.3.9", ] @@ -135,12 +125,11 @@ checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" [[package]] name = "calloop" -version = "0.4.4" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7aa2097be53a00de9e8fc349fea6d76221f398f5c4fa550d420669906962d160" +checksum = "0b036167e76041694579972c28cf4877b4f92da222560ddb49008937b6a6727c" dependencies = [ - "mio", - "mio-extras", + "log", "nix", ] @@ -177,22 +166,13 @@ version = "0.4.19" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" dependencies = [ - "libc 0.2.80", + "libc", "num-integer", "num-traits", "time", "winapi 0.3.9", ] -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" -dependencies = [ - "bitflags", -] - [[package]] name = "cloudabi" version = "0.1.0" @@ -204,16 +184,17 @@ dependencies = [ [[package]] name = "cocoa" -version = "0.20.2" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c49e86fc36d5704151f5996b7b3795385f50ce09e3be0f47a0cfde869681cf8" +checksum = "6f63902e9223530efb4e26ccd0cf55ec30d592d3b42e21a28defc42a9586e832" dependencies = [ "bitflags", "block", - "core-foundation 0.7.0", - "core-graphics", + "cocoa-foundation", + "core-foundation 0.9.1", + "core-graphics 0.22.2", "foreign-types", - "libc 0.2.80", + "libc", "objc", ] @@ -228,7 +209,7 @@ dependencies = [ "core-foundation 0.9.1", "core-graphics-types", "foreign-types", - "libc 0.2.80", + "libc", "objc", ] @@ -245,7 +226,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" dependencies = [ "core-foundation-sys 0.7.0", - "libc 0.2.80", + "libc", ] [[package]] @@ -255,7 +236,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a89e2ae426ea83155dccf10c0fa6b1463ef6d5fcb44cee0b224a408fa640a62" dependencies = [ "core-foundation-sys 0.8.2", - "libc 0.2.80", + "libc", ] [[package]] @@ -279,7 +260,20 @@ dependencies = [ "bitflags", "core-foundation 0.7.0", "foreign-types", - "libc 0.2.80", + "libc", +] + +[[package]] +name = "core-graphics" +version = "0.22.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "269f35f69b542b80e736a20a89a05215c0ce80c2c03c514abb2e318b78379d86" +dependencies = [ + "bitflags", + "core-foundation 0.9.1", + "core-graphics-types", + "foreign-types", + "libc", ] [[package]] @@ -291,7 +285,7 @@ dependencies = [ "bitflags", "core-foundation 0.9.1", "foreign-types", - "libc 0.2.80", + "libc", ] [[package]] @@ -302,8 +296,8 @@ checksum = "34ecad23610ad9757664d644e369246edde1803fcb43ed72876565098a5d3828" dependencies = [ "cfg-if 0.1.10", "core-foundation-sys 0.7.0", - "core-graphics", - "libc 0.2.80", + "core-graphics 0.19.2", + "libc", "objc", ] @@ -318,14 +312,49 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "darling" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d706e75d87e35569db781a9b5e2416cff1236a47ed380831f959382ccd5f858" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0c960ae2da4de88a91b2d920c2a7233b400bc33cb28453a2987822d8392519b" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn", +] + +[[package]] +name = "darling_macro" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b5a2f4ac4969822c62224815d069952656cadc7084fdca9751e6d959189b72" +dependencies = [ + "darling_core", + "quote", + "syn", +] + [[package]] name = "derivative" version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cb582b60359da160a9477ee80f15c8d784c477e69c217ef2cdd4169c24ea380f" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", + "proc-macro2", + "quote", "syn", ] @@ -359,9 +388,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.7.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" +checksum = "f26ecb66b4bdca6c1409b40fb255eefc2bd4f6d135dab3c3124f80ffa2a9661e" dependencies = [ "atty", "humantime", @@ -378,13 +407,19 @@ checksum = "37ab347416e802de484e4d03c7316c48f1ecb56574dfd4a46a80f173ce1de04d" [[package]] name = "float-cmp" -version = "0.7.0" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "499a1bfa03d254b047e7e5c1fc8dd23a8cf6b344a8eb7e622ae4bc76bfac8e68" +checksum = "e1267f4ac4f343772758f7b1bdcbe767c218bbab93bb432acbf5162bbf85a6c4" dependencies = [ "num-traits", ] +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "foreign-types" version = "0.3.2" @@ -432,7 +467,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8cdc09201b2e8ca1b19290cf7e65de2246b8e91fb6874279722189c4de7b94dc" dependencies = [ "cc", - "libc 0.2.80", + "libc", "log", "rustc_version", "winapi 0.3.9", @@ -441,7 +476,7 @@ dependencies = [ [[package]] name = "gfx-auxil" version = "0.5.0" -source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" +source = "git+https://github.com/gfx-rs/gfx?rev=7dc99d525cc7ad04161f227993181f36c68fe86e#7dc99d525cc7ad04161f227993181f36c68fe86e" dependencies = [ "fxhash", "gfx-hal", @@ -451,7 +486,7 @@ dependencies = [ [[package]] name = "gfx-backend-dx11" version = "0.6.0" -source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" +source = "git+https://github.com/gfx-rs/gfx?rev=7dc99d525cc7ad04161f227993181f36c68fe86e#7dc99d525cc7ad04161f227993181f36c68fe86e" dependencies = [ "arrayvec", "bitflags", @@ -459,7 +494,7 @@ dependencies = [ "gfx-hal", "libloading", "log", - "parking_lot 0.11.0", + "parking_lot", "range-alloc", "raw-window-handle", "smallvec", @@ -472,7 +507,7 @@ dependencies = [ [[package]] name = "gfx-backend-dx12" version = "0.6.2" -source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" +source = "git+https://github.com/gfx-rs/gfx?rev=7dc99d525cc7ad04161f227993181f36c68fe86e#7dc99d525cc7ad04161f227993181f36c68fe86e" dependencies = [ "arrayvec", "bit-set", @@ -481,7 +516,7 @@ dependencies = [ "gfx-auxil", "gfx-hal", "log", - "parking_lot 0.11.0", + "parking_lot", "range-alloc", "raw-window-handle", "smallvec", @@ -492,7 +527,7 @@ dependencies = [ [[package]] name = "gfx-backend-empty" version = "0.6.0" -source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" +source = "git+https://github.com/gfx-rs/gfx?rev=7dc99d525cc7ad04161f227993181f36c68fe86e#7dc99d525cc7ad04161f227993181f36c68fe86e" dependencies = [ "gfx-hal", "log", @@ -502,7 +537,7 @@ dependencies = [ [[package]] name = "gfx-backend-gl" version = "0.6.0" -source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" +source = "git+https://github.com/gfx-rs/gfx?rev=7dc99d525cc7ad04161f227993181f36c68fe86e#7dc99d525cc7ad04161f227993181f36c68fe86e" dependencies = [ "arrayvec", "bitflags", @@ -514,7 +549,7 @@ dependencies = [ "libloading", "log", "naga", - "parking_lot 0.11.0", + "parking_lot", "raw-window-handle", "smallvec", "spirv_cross", @@ -525,7 +560,7 @@ dependencies = [ [[package]] name = "gfx-backend-metal" version = "0.6.0" -source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" +source = "git+https://github.com/gfx-rs/gfx?rev=7dc99d525cc7ad04161f227993181f36c68fe86e#7dc99d525cc7ad04161f227993181f36c68fe86e" dependencies = [ "arrayvec", "bitflags", @@ -539,7 +574,7 @@ dependencies = [ "metal", "naga", "objc", - "parking_lot 0.11.0", + "parking_lot", "range-alloc", "raw-window-handle", "spirv_cross", @@ -549,7 +584,7 @@ dependencies = [ [[package]] name = "gfx-backend-vulkan" version = "0.6.5" -source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" +source = "git+https://github.com/gfx-rs/gfx?rev=7dc99d525cc7ad04161f227993181f36c68fe86e#7dc99d525cc7ad04161f227993181f36c68fe86e" dependencies = [ "arrayvec", "ash", @@ -560,7 +595,7 @@ dependencies = [ "log", "naga", "objc", - "parking_lot 0.11.0", + "parking_lot", "raw-window-handle", "smallvec", "winapi 0.3.9", @@ -569,7 +604,7 @@ dependencies = [ [[package]] name = "gfx-hal" version = "0.6.0" -source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" +source = "git+https://github.com/gfx-rs/gfx?rev=7dc99d525cc7ad04161f227993181f36c68fe86e#7dc99d525cc7ad04161f227993181f36c68fe86e" dependencies = [ "bitflags", "naga", @@ -592,7 +627,7 @@ dependencies = [ [[package]] name = "gpu-alloc" version = "0.2.1" -source = "git+https://github.com/zakarumych/gpu-alloc?rev=29e761f24edc50e28d238e723503b146d55d222e#29e761f24edc50e28d238e723503b146d55d222e" +source = "git+https://github.com/zakarumych/gpu-alloc?rev=15f4fe2cebbd0bf9ab446757a8e370e0adf4c502#15f4fe2cebbd0bf9ab446757a8e370e0adf4c502" dependencies = [ "bitflags", "gpu-alloc-types", @@ -602,7 +637,7 @@ dependencies = [ [[package]] name = "gpu-alloc-types" version = "0.1.0" -source = "git+https://github.com/zakarumych/gpu-alloc?rev=29e761f24edc50e28d238e723503b146d55d222e#29e761f24edc50e28d238e723503b146d55d222e" +source = "git+https://github.com/zakarumych/gpu-alloc?rev=15f4fe2cebbd0bf9ab446757a8e370e0adf4c502#15f4fe2cebbd0bf9ab446757a8e370e0adf4c502" dependencies = [ "bitflags", ] @@ -610,7 +645,7 @@ dependencies = [ [[package]] name = "gpu-descriptor" version = "0.1.0" -source = "git+https://github.com/zakarumych/gpu-descriptor?rev=df74fd8c7bea03149058a41aab0e4fe04077b266#df74fd8c7bea03149058a41aab0e4fe04077b266" +source = "git+https://github.com/zakarumych/gpu-descriptor?rev=aa092613889f03f8254d6f7278d08c655324c7c7#aa092613889f03f8254d6f7278d08c655324c7c7" dependencies = [ "bitflags", "gpu-descriptor-types", @@ -621,7 +656,7 @@ dependencies = [ [[package]] name = "gpu-descriptor-types" version = "0.1.0" -source = "git+https://github.com/zakarumych/gpu-descriptor?rev=df74fd8c7bea03149058a41aab0e4fe04077b266#df74fd8c7bea03149058a41aab0e4fe04077b266" +source = "git+https://github.com/zakarumych/gpu-descriptor?rev=aa092613889f03f8254d6f7278d08c655324c7c7#aa092613889f03f8254d6f7278d08c655324c7c7" dependencies = [ "bitflags", ] @@ -641,17 +676,20 @@ version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" dependencies = [ - "libc 0.2.80", + "libc", ] [[package]] name = "humantime" -version = "1.3.0" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -dependencies = [ - "quick-error", -] +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "indexmap" @@ -684,7 +722,7 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" dependencies = [ - "libc 0.2.80", + "libc", ] [[package]] @@ -705,7 +743,7 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c71313ebb9439f74b00d9d2dcec36440beaf57a6aa0623068441dd7cd81a7f2" dependencies = [ - "libc 0.2.80", + "libc", ] [[package]] @@ -732,7 +770,7 @@ name = "khronos-egl" version = "3.0.0-beta" source = "git+https://github.com/timothee-haudebourg/khronos-egl?rev=9568b2ee3b02f2c17cc9479f824db16daecf1664#9568b2ee3b02f2c17cc9479f824db16daecf1664" dependencies = [ - "libc 0.2.80", + "libc", "libloading", ] @@ -748,12 +786,6 @@ version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" -[[package]] -name = "libc" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e32a70cf75e5846d53a673923498228bbec6a8624708a9ea5645f075d6276122" - [[package]] name = "libc" version = "0.2.80" @@ -770,24 +802,6 @@ dependencies = [ "winapi 0.3.9", ] -[[package]] -name = "line_drawing" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cc7ad3d82c845bdb5dde34ffdcc7a5fb4d2996e1e1ee0f19c33bc80e15196b9" -dependencies = [ - "num-traits", -] - -[[package]] -name = "lock_api" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" -dependencies = [ - "scopeguard", -] - [[package]] name = "lock_api" version = "0.4.1" @@ -825,7 +839,7 @@ version = "0.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" dependencies = [ - "libc 0.1.12", + "libc", ] [[package]] @@ -850,13 +864,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" [[package]] -name = "memmap" -version = "0.7.0" +name = "memmap2" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6585fd95e7bb50d6cc31e20d4cf9afb4e2ba16c5846fc76793f11218da9c475b" +checksum = "d9b70ca2a6103ac8b665dc150b142ef0e4e89df640c9e6cf295d189c3caebe5a" dependencies = [ - "libc 0.2.80", - "winapi 0.3.9", + "libc", ] [[package]] @@ -883,7 +896,7 @@ dependencies = [ "fuchsia-zircon-sys", "iovec", "kernel32-sys", - "libc 0.2.80", + "libc", "log", "miow", "net2", @@ -932,34 +945,48 @@ dependencies = [ [[package]] name = "ndk" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95a356cafe20aee088789830bfea3a61336e84ded9e545e00d3869ce95dcb80c" +checksum = "5eb167c1febed0a496639034d0c76b3b74263636045db5489eee52143c246e73" dependencies = [ "jni-sys", "ndk-sys", "num_enum", + "thiserror", ] [[package]] name = "ndk-glue" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1730ee2e3de41c3321160a6da815f008c4006d71b095880ea50e17cf52332b8" +checksum = "bdf399b8b7a39c6fb153c4ec32c72fd5fe789df24a647f229c239aa7adb15241" dependencies = [ - "android_log-sys", "lazy_static", - "libc 0.2.80", + "libc", "log", "ndk", + "ndk-macro", "ndk-sys", ] [[package]] -name = "ndk-sys" -version = "0.1.0" +name = "ndk-macro" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b2820aca934aba5ed91c79acc72b6a44048ceacc5d36c035ed4e051f12d887d" +checksum = "05d1c6307dc424d0f65b9b06e94f88248e6305726b14729fd67a5e47b2dc481d" +dependencies = [ + "darling", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn", +] + +[[package]] +name = "ndk-sys" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c44922cb3dbb1c70b5e5f443d63b64363a898564d739ba5198e3a9138442868d" [[package]] name = "net2" @@ -968,21 +995,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" dependencies = [ "cfg-if 0.1.10", - "libc 0.2.80", + "libc", "winapi 0.3.9", ] [[package]] name = "nix" -version = "0.14.1" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c722bee1037d430d0f8e687bbdbf222f27cc6e4e68d5caf630857bb2b6dbdce" +checksum = "83450fe6a6142ddd95fb064b746083fc4ef1705fe81f64a64e1d4b39f54a1055" dependencies = [ "bitflags", "cc", "cfg-if 0.1.10", - "libc 0.2.80", - "void", + "libc", +] + +[[package]] +name = "nom" +version = "6.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88034cfd6b4a0d54dd14f4a507eceee36c0b70e5a02236c4e4df571102be17f0" +dependencies = [ + "memchr", + "version_check", ] [[package]] @@ -1021,8 +1057,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ffa5a33ddddfee04c0283a7653987d634e880347e96b5b2ed64de07efb59db9d" dependencies = [ "proc-macro-crate", - "proc-macro2 1.0.24", - "quote 1.0.7", + "proc-macro2", + "quote", "syn", ] @@ -1052,22 +1088,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" [[package]] -name = "ordered-float" -version = "1.1.0" +name = "owned_ttf_parser" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3741934be594d77de1c8461ebcbbe866f585ea616a9753aa78f2bdc69f0e4579" +checksum = "9f923fb806c46266c02ab4a5b239735c144bdeda724a50ed058e5226f594cde3" dependencies = [ - "num-traits", -] - -[[package]] -name = "parking_lot" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3a704eb390aafdc107b0e392f56a82b668e3a71366993b5340f5833fd62505e" -dependencies = [ - "lock_api 0.3.4", - "parking_lot_core 0.7.2", + "ttf-parser", ] [[package]] @@ -1077,22 +1103,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4893845fa2ca272e647da5d0e46660a314ead9c2fdd9a883aabc32e481a8733" dependencies = [ "instant", - "lock_api 0.4.1", - "parking_lot_core 0.8.0", -] - -[[package]] -name = "parking_lot_core" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d58c7c768d4ba344e3e8d72518ac13e259d7c7ade24167003b8488e10b6740a3" -dependencies = [ - "cfg-if 0.1.10", - "cloudabi 0.0.3", - "libc 0.2.80", - "redox_syscall", - "smallvec", - "winapi 0.3.9", + "lock_api", + "parking_lot_core", ] [[package]] @@ -1102,9 +1114,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c361aa727dd08437f2f1447be8b59a33b0edd15e0fcee698f935613d9efbca9b" dependencies = [ "cfg-if 0.1.10", - "cloudabi 0.1.0", + "cloudabi", "instant", - "libc 0.2.80", + "libc", "redox_syscall", "smallvec", "winapi 0.3.9", @@ -1163,37 +1175,13 @@ dependencies = [ "toml", ] -[[package]] -name = "proc-macro2" -version = "0.4.30" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf3d2011ab5c909338f7887f4fc896d35932e29146c12c8d01da6b22a80ba759" -dependencies = [ - "unicode-xid 0.1.0", -] - [[package]] name = "proc-macro2" version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" dependencies = [ - "unicode-xid 0.2.1", -] - -[[package]] -name = "quick-error" -version = "1.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" - -[[package]] -name = "quote" -version = "0.6.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ce23b6b870e8f94f81fb0a363d65d86675884b34a09043c81e5562f11c1f8e1" -dependencies = [ - "proc-macro2 0.4.30", + "unicode-xid", ] [[package]] @@ -1202,13 +1190,13 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" dependencies = [ - "proc-macro2 1.0.24", + "proc-macro2", ] [[package]] name = "range-alloc" version = "0.1.1" -source = "git+https://github.com/gfx-rs/gfx?rev=006f0c00782d5f602b4afa8e1fa9ffc2085af997#006f0c00782d5f602b4afa8e1fa9ffc2085af997" +source = "git+https://github.com/gfx-rs/gfx?rev=7dc99d525cc7ad04161f227993181f36c68fe86e#7dc99d525cc7ad04161f227993181f36c68fe86e" [[package]] name = "raw-window-handle" @@ -1216,7 +1204,7 @@ version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0a441a7a6c80ad6473bd4b74ec1c9a4c951794285bf941c2126f607c72e48211" dependencies = [ - "libc 0.2.80", + "libc", ] [[package]] @@ -1255,9 +1243,9 @@ checksum = "3b181ba2dcf07aaccad5448e8ead58db5b742cf85dfe035e2227f137a539a189" [[package]] name = "renderdoc" -version = "0.8.1" +version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c9e8488c98756911664c8cc7b86284c320b6a6357d95908458136d7ebe9280c" +checksum = "58fd0c55a54ecce0889aaca4ee87831cfe8c83c275c439443162be1f0eab5fdc" dependencies = [ "bitflags", "float-cmp", @@ -1270,9 +1258,9 @@ dependencies = [ [[package]] name = "renderdoc-sys" -version = "0.6.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60d4a9058849c3e765fe2fa68b72c1416b1766f27eac3c52d7bac8712ea0d390" +checksum = "f1382d1f0a252c4bf97dc20d979a2fdd05b024acd7c2ed0f7595d7817666a157" [[package]] name = "ron" @@ -1296,22 +1284,12 @@ dependencies = [ [[package]] name = "rusttype" -version = "0.7.9" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "310942406a39981bed7e12b09182a221a29e0990f3e7e0c971f131922ed135d5" +checksum = "dc7c727aded0be18c5b80c1640eae0ac8e396abf6fa8477d96cb37d18ee5ec59" dependencies = [ - "rusttype 0.8.3", -] - -[[package]] -name = "rusttype" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f61411055101f7b60ecf1041d87fb74205fb20b0c7a723f07ef39174cf6b4c0" -dependencies = [ - "approx", - "ordered-float", - "stb_truetype", + "ab_glyph_rasterizer", + "owned_ttf_parser", ] [[package]] @@ -1371,8 +1349,8 @@ version = "1.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbd1ae72adb44aab48f325a02444a5fc079349a8d804c1fc922aed3f7454c74e" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", + "proc-macro2", + "quote", "syn", ] @@ -1417,25 +1395,28 @@ checksum = "fbee7696b84bbf3d89a1c2eccff0850e3047ed46bfcd2e92c29a2d074d57e252" [[package]] name = "smithay-client-toolkit" -version = "0.6.6" +version = "0.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "421c8dc7acf5cb205b88160f8b4cc2c5cfabe210e43b2f80f009f4c1ef910f1d" +checksum = "316e13a3eb853ce7bf72ad3530dc186cb2005c57c521ef5f4ada5ee4eed74de6" dependencies = [ "andrew", "bitflags", + "calloop", "dlib", "lazy_static", - "memmap", + "log", + "memmap2", "nix", "wayland-client", + "wayland-cursor", "wayland-protocols", ] [[package]] name = "spirv_cross" -version = "0.22.0" +version = "0.22.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8221f4aebf53a4447aebd4fe29ebff2c66dd2c2821e63675e09e85bd21c8633" +checksum = "0ebd49af36be83ecd6290b57147e2a0e26145b832634b17146d934b197ca3713" dependencies = [ "cc", "js-sys", @@ -1452,33 +1433,30 @@ dependencies = [ "num-traits", ] -[[package]] -name = "stb_truetype" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f77b6b07e862c66a9f3e62a07588fee67cd90a9135a2b942409f195507b4fb51" -dependencies = [ - "byteorder", -] - [[package]] name = "storage-map" version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "418bb14643aa55a7841d5303f72cf512cfb323b8cc221d51580500a1ca75206c" dependencies = [ - "lock_api 0.4.1", + "lock_api", ] +[[package]] +name = "strsim" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6446ced80d6c486436db5c078dde11a9f73d42b57fb273121e160b84f63d894c" + [[package]] name = "syn" version = "1.0.48" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cc371affeffc477f42a221a1e4297aedcea33d47d19b61455588bd9d8f6b19ac" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", - "unicode-xid 0.2.1", + "proc-macro2", + "quote", + "unicode-xid", ] [[package]] @@ -1505,8 +1483,8 @@ version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ba20f23e85b10754cd195504aebf6a27e2e6cbe28c17778a0c930724628dd56" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", + "proc-macro2", + "quote", "syn", ] @@ -1516,7 +1494,7 @@ version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c7fbf4c9d56b320106cd64fd024dadfa0be7cb4706725fc44a7d7ce952d820c1" dependencies = [ - "libc 0.2.80", + "libc", "redox_syscall", "winapi 0.3.9", ] @@ -1542,7 +1520,7 @@ version = "0.1.44" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" dependencies = [ - "libc 0.2.80", + "libc", "wasi", "winapi 0.3.9", ] @@ -1574,8 +1552,8 @@ version = "0.1.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "80e0ccfc3378da0cce270c946b676a376943f5cd16aeba64568e7939806f4ada" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", + "proc-macro2", + "quote", "syn", ] @@ -1632,10 +1610,10 @@ dependencies = [ ] [[package]] -name = "unicode-xid" -version = "0.1.0" +name = "ttf-parser" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc72304796d0818e357ead4e000d19c9c174ab23dc11093ac919054d20a6a7fc" +checksum = "3e5d7cd7ab3e47dda6e56542f4bbf3824c15234958c6e1bd6aaa347e93499fdc" [[package]] name = "unicode-xid" @@ -1644,10 +1622,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" [[package]] -name = "void" -version = "1.0.2" +name = "version_check" +version = "0.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d" +checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" [[package]] name = "walkdir" @@ -1685,8 +1663,8 @@ dependencies = [ "bumpalo", "lazy_static", "log", - "proc-macro2 1.0.24", - "quote 1.0.7", + "proc-macro2", + "quote", "syn", "wasm-bindgen-shared", ] @@ -1697,7 +1675,7 @@ version = "0.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8bd151b63e1ea881bb742cd20e1d6127cef28399558f3b5d415289bc41eee3a4" dependencies = [ - "quote 1.0.7", + "quote", "wasm-bindgen-macro-support", ] @@ -1707,8 +1685,8 @@ version = "0.2.60" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d68a5b36eef1be7868f668632863292e37739656a80fc4b9acec7b0bd35a4931" dependencies = [ - "proc-macro2 1.0.24", - "quote 1.0.7", + "proc-macro2", + "quote", "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", @@ -1722,16 +1700,15 @@ checksum = "daf76fe7d25ac79748a37538b7daeed1c7a6867c92d3245c12c6222e4a20d639" [[package]] name = "wayland-client" -version = "0.23.6" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af1080ebe0efabcf12aef2132152f616038f2d7dcbbccf7b2d8c5270fe14bcda" +checksum = "bdbdbe01d03b2267809f3ed99495b37395387fde789e0f2ebb78e8b43f75b6d7" dependencies = [ "bitflags", - "calloop", "downcast-rs", - "libc 0.2.80", - "mio", + "libc", "nix", + "scoped-tls", "wayland-commons", "wayland-scanner", "wayland-sys", @@ -1739,19 +1716,32 @@ dependencies = [ [[package]] name = "wayland-commons" -version = "0.23.6" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb66b0d1a27c39bbce712b6372131c6e25149f03ffb0cd017cf8f7de8d66dbdb" +checksum = "480450f76717edd64ad04a4426280d737fc3d10a236b982df7b1aee19f0e2d56" dependencies = [ "nix", + "once_cell", + "smallvec", "wayland-sys", ] [[package]] -name = "wayland-protocols" -version = "0.23.6" +name = "wayland-cursor" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6cc286643656742777d55dc8e70d144fa4699e426ca8e9d4ef454f4bf15ffcf9" +checksum = "d6eb122c160223a7660feeaf949d0100281d1279acaaed3720eb3c9894496e5f" +dependencies = [ + "nix", + "wayland-client", + "xcursor", +] + +[[package]] +name = "wayland-protocols" +version = "0.28.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "319a82b4d3054dd25acc32d9aee0f84fa95b63bc983fffe4703b6b8d47e01a30" dependencies = [ "bitflags", "wayland-client", @@ -1761,23 +1751,24 @@ dependencies = [ [[package]] name = "wayland-scanner" -version = "0.23.6" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93b02247366f395b9258054f964fe293ddd019c3237afba9be2ccbe9e1651c3d" +checksum = "7010ba5767b3fcd350decc59055390b4ebe6bd1b9279a9feb1f1888987f1133d" dependencies = [ - "proc-macro2 0.4.30", - "quote 0.6.13", + "proc-macro2", + "quote", "xml-rs", ] [[package]] name = "wayland-sys" -version = "0.23.6" +version = "0.28.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d94e89a86e6d6d7c7c9b19ebf48a03afaac4af6bc22ae570e9a24124b75358f4" +checksum = "6793834e0c35d11fd96a97297abe03d37be627e1847da52e17d7e0e3b51cc099" dependencies = [ "dlib", "lazy_static", + "pkg-config", ] [[package]] @@ -1810,7 +1801,7 @@ dependencies = [ "gpu-descriptor", "loom", "naga", - "parking_lot 0.11.0", + "parking_lot", "raw-window-handle", "ron", "serde", @@ -1825,7 +1816,7 @@ name = "wgpu-subscriber" version = "0.1.0" source = "git+https://github.com/gfx-rs/subscriber.git?rev=cdc9feb53f152f9c41905ed9efeff2c1ed214361#cdc9feb53f152f9c41905ed9efeff2c1ed214361" dependencies = [ - "parking_lot 0.11.0", + "parking_lot", "thread-id", "tracing", "tracing-log", @@ -1885,19 +1876,19 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "winit" -version = "0.22.2" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e4ccbf7ddb6627828eace16cacde80fc6bf4dbb3469f88487262a02cf8e7862" +checksum = "da4eda6fce0eb84bd0a33e3c8794eb902e1033d0a1d5a31bc4f19b1b4bbff597" dependencies = [ "bitflags", "cocoa", - "core-foundation 0.7.0", - "core-graphics", + "core-foundation 0.9.1", + "core-graphics 0.22.2", "core-video-sys", "dispatch", "instant", "lazy_static", - "libc 0.2.80", + "libc", "log", "mio", "mio-extras", @@ -1905,7 +1896,7 @@ dependencies = [ "ndk-glue", "ndk-sys", "objc", - "parking_lot 0.10.2", + "parking_lot", "percent-encoding", "raw-window-handle", "smithay-client-toolkit", @@ -1940,11 +1931,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf981e3a5b3301209754218f962052d4d9ee97e478f4d26d4a6eced34c1fef8" dependencies = [ "lazy_static", - "libc 0.2.80", + "libc", "maybe-uninit", "pkg-config", ] +[[package]] +name = "xcursor" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3a9a231574ae78801646617cefd13bfe94be907c0e4fa979cfd8b770aa3c5d08" +dependencies = [ + "nom", +] + [[package]] name = "xdg" version = "2.2.0" diff --git a/player/Cargo.toml b/player/Cargo.toml index 537a725323..2ecdd631c4 100644 --- a/player/Cargo.toml +++ b/player/Cargo.toml @@ -15,12 +15,12 @@ publish = false [features] [dependencies] -env_logger = "0.7" +env_logger = "0.8" log = "0.4" raw-window-handle = "0.3" -renderdoc = { version = "0.8", optional = true, default_features = false } +renderdoc = { version = "0.10", optional = true, default_features = false } ron = "0.6" -winit = { version = "0.22", optional = true } +winit = { version = "0.24", optional = true } [dependencies.wgt] path = "../wgpu-types" diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index 1c7e305448..6e58f8dcb0 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -33,27 +33,27 @@ smallvec = "1" tracing = { version = "0.1", default-features = false, features = ["std"] } thiserror = "1" -gpu-alloc = { git = "https://github.com/zakarumych/gpu-alloc", rev = "29e761f24edc50e28d238e723503b146d55d222e", features = ["tracing"] } -gpu-descriptor = { git = "https://github.com/zakarumych/gpu-descriptor", rev = "df74fd8c7bea03149058a41aab0e4fe04077b266", features = ["tracing"] } +gpu-alloc = { git = "https://github.com/zakarumych/gpu-alloc", rev = "15f4fe2cebbd0bf9ab446757a8e370e0adf4c502", features = ["tracing"] } +gpu-descriptor = { git = "https://github.com/zakarumych/gpu-descriptor", rev = "aa092613889f03f8254d6f7278d08c655324c7c7", features = ["tracing"] } -hal = { package = "gfx-hal", git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997" } -gfx-backend-empty = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997" } +hal = { package = "gfx-hal", git = "https://github.com/gfx-rs/gfx", rev = "7dc99d525cc7ad04161f227993181f36c68fe86e" } +gfx-backend-empty = { git = "https://github.com/gfx-rs/gfx", rev = "7dc99d525cc7ad04161f227993181f36c68fe86e" } [target.'cfg(all(not(target_arch = "wasm32"), all(unix, not(target_os = "ios"), not(target_os = "macos"))))'.dependencies] -gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997", features = ["naga"] } -gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997", features = ["naga"] } +gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "7dc99d525cc7ad04161f227993181f36c68fe86e", features = ["naga"] } +gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "7dc99d525cc7ad04161f227993181f36c68fe86e", features = ["naga"] } [target.'cfg(all(not(target_arch = "wasm32"), any(target_os = "ios", target_os = "macos")))'.dependencies] -gfx-backend-metal = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997", features = ["naga"] } -gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997", optional = true } +gfx-backend-metal = { git = "https://github.com/gfx-rs/gfx", rev = "7dc99d525cc7ad04161f227993181f36c68fe86e", features = ["naga"] } +gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "7dc99d525cc7ad04161f227993181f36c68fe86e", optional = true } [target.'cfg(all(not(target_arch = "wasm32"), windows))'.dependencies] -gfx-backend-dx12 = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997" } -gfx-backend-dx11 = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997" } -gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997", features = ["naga"] } +gfx-backend-dx12 = { git = "https://github.com/gfx-rs/gfx", rev = "7dc99d525cc7ad04161f227993181f36c68fe86e" } +gfx-backend-dx11 = { git = "https://github.com/gfx-rs/gfx", rev = "7dc99d525cc7ad04161f227993181f36c68fe86e" } +gfx-backend-vulkan = { git = "https://github.com/gfx-rs/gfx", rev = "7dc99d525cc7ad04161f227993181f36c68fe86e", features = ["naga"] } [target.'cfg(target_arch = "wasm32")'.dependencies] -gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "006f0c00782d5f602b4afa8e1fa9ffc2085af997", features = ["naga"] } +gfx-backend-gl = { git = "https://github.com/gfx-rs/gfx", rev = "7dc99d525cc7ad04161f227993181f36c68fe86e", features = ["naga"] } [dependencies.naga] git = "https://github.com/gfx-rs/naga"