From acfa8ecb35dbecfd75ada7079e9892e7bd36ab5a Mon Sep 17 00:00:00 2001 From: Dzmitry Malyshau Date: Thu, 16 Apr 2020 21:49:24 -0400 Subject: [PATCH] Derive swapchain layout off the load operation --- wgpu-core/src/command/render.rs | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/wgpu-core/src/command/render.rs b/wgpu-core/src/command/render.rs index 4f08bfffd9..3c06037fdc 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 } };