]> git.nega.tv - josh/narcissus/commitdiff
narcissus-gpu: Make validation layers about dst access
authorJoshua Simmons <josh@nega.tv>
Mon, 18 Nov 2024 17:54:41 +0000 (18:54 +0100)
committerJoshua Simmons <josh@nega.tv>
Mon, 18 Nov 2024 17:54:41 +0000 (18:54 +0100)
A bit of an open question what's actually required here, but this makes
the validation layers happy so let's go with that.

engine/narcissus-gpu/src/backend/vulkan/barrier.rs

index 9e32275b704b3d321ae016a20bcac4eb9994a26c..72092aa57a3ff00325429d90b9e0fdc072fda81b 100644 (file)
@@ -298,14 +298,9 @@ pub fn vulkan_image_memory_barrier(
         let info = vulkan_access_info(access);
         dst_stage_mask |= info.stages;
 
-        // Add visibility operations if necessary.
-        //
-        // If the src access mask is zero, this is a write-after-read hazard (or for
-        // some reason, a read-after-read hazard), so the dst access mask can be safely
-        // zeroed as these don't need visibility.
-        if src_access_mask != default() {
-            dst_access_mask |= info.access;
-        }
+        // Open question whether this is always required.
+        // <https://github.com/Tobski/simple_vulkan_synchronization/issues/19#issuecomment-1460325972>
+        dst_access_mask |= info.access;
 
         let layout = match barrier.next_layout {
             ImageLayout::Optimal => info.layout,