599: [0.5] texture storage read fix r=kvark a=kvark

This is blocked on @cwfitzgerald confirming/denying if this is a proper fix for https://github.com/gfx-rs/wgpu-rs/issues/253

Co-authored-by: Almar Klein <almar.klein@gmail.com>
Co-authored-by: Dzmitry Malyshau <kvarkus@gmail.com>
This commit is contained in:
bors[bot] 2020-04-19 02:32:12 +00:00 committed by GitHub
commit d937742da7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 20 additions and 15 deletions

View File

@ -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

6
Cargo.lock generated
View File

@ -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",
]

View File

@ -1,6 +1,6 @@
[package]
name = "wgpu-core"
version = "0.5.2"
version = "0.5.3"
authors = [
"Dzmitry Malyshau <kvark@mozilla.com>",
"Joshua Groves <josh@joshgroves.com>",

View File

@ -485,9 +485,9 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
}
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<G: GlobalIdentityHandlerFactory> Global<G> {
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
}
};

View File

@ -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

View File

@ -1466,6 +1466,7 @@ impl<G: GlobalIdentityHandlerFactory> Global<G> {
}
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);