diff --git a/CHANGELOG.md b/CHANGELOG.md index 9546c72fd..4743531b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Change Log +## v0.5.3 (18-04-2020) + - fix reading access to storage textures + - another fix to layout transitions for swapchain images + ## v0.5.2 (15-04-2020) - fix read-only storage flags - fix pipeline layout life time diff --git a/Cargo.lock b/Cargo.lock index 3dbdc9ece..342a000df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -653,7 +653,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "wgpu-core" -version = "0.5.2" +version = "0.5.3" dependencies = [ "arrayvec 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)", "battery 0.7.5 (registry+https://github.com/rust-lang/crates.io-index)", @@ -687,7 +687,7 @@ dependencies = [ "objc 0.2.7 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", "raw-window-handle 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)", - "wgpu-core 0.5.2", + "wgpu-core 0.5.3", "wgpu-types 0.5.0", ] @@ -697,7 +697,7 @@ version = "0.1.0" dependencies = [ "log 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)", "parking_lot 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", - "wgpu-core 0.5.2", + "wgpu-core 0.5.3", "wgpu-types 0.5.0", ] diff --git a/wgpu-core/Cargo.toml b/wgpu-core/Cargo.toml index 4d7216286..b4c2e2271 100644 --- a/wgpu-core/Cargo.toml +++ b/wgpu-core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "wgpu-core" -version = "0.5.2" +version = "0.5.3" authors = [ "Dzmitry Malyshau ", "Joshua Groves ", diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 4f08bfffd..3c06037fd 100644 --- a/wgpu-core/src/command/render.rs +++ b/wgpu-core/src/command/render.rs @@ -485,9 +485,9 @@ impl Global { } let end = hal::image::Layout::Present; - let start = match base_trackers.views.query(at.attachment, ()) { - Some(_) => end, - None => hal::image::Layout::Undefined, + let start = match at.load_op { + LoadOp::Clear => hal::image::Layout::Undefined, + LoadOp::Load => end, }; start..end } @@ -535,13 +535,7 @@ impl Global { assert!(used_swap_chain.is_none()); used_swap_chain = Some(source_id.clone()); } - - let end = hal::image::Layout::Present; - let start = match base_trackers.views.query(resolve_target, ()) { - Some(_) => end, - None => hal::image::Layout::Undefined, - }; - start..end + hal::image::Layout::Undefined..hal::image::Layout::Present } }; diff --git a/wgpu-core/src/conv.rs b/wgpu-core/src/conv.rs index 22c8e9563..e4bfce1af 100644 --- a/wgpu-core/src/conv.rs +++ b/wgpu-core/src/conv.rs @@ -500,6 +500,12 @@ pub fn map_buffer_state(usage: wgt::BufferUsage) -> hal::buffer::State { use wgt::BufferUsage as W; let mut access = A::empty(); + if usage.contains(W::MAP_READ) { + access |= A::HOST_READ; + } + if usage.contains(W::MAP_WRITE) { + access |= A::HOST_WRITE; + } if usage.contains(W::COPY_SRC) { access |= A::TRANSFER_READ; } @@ -554,7 +560,7 @@ pub fn map_texture_state( access |= A::SHADER_READ; } if usage.contains(W::STORAGE) { - access |= A::SHADER_WRITE; + access |= A::SHADER_READ | A::SHADER_WRITE; } if usage.contains(W::OUTPUT_ATTACHMENT) { //TODO: read-only attachments diff --git a/wgpu-core/src/device/mod.rs b/wgpu-core/src/device/mod.rs index a485df6f9..ec324d888 100644 --- a/wgpu-core/src/device/mod.rs +++ b/wgpu-core/src/device/mod.rs @@ -1466,6 +1466,7 @@ impl Global { } if !buffer_guard[id].life_guard.use_at(submit_index) { if let resource::BufferMapState::Active = buffer_guard[id].map_state { + log::warn!("Dropped buffer has a pending mapping."); unmap_buffer(&device.raw, &mut buffer_guard[id]); } device.temp_suspected.buffers.push(id);