From b370d13743d8c2bde4d090f0db0dfb053f1bd688 Mon Sep 17 00:00:00 2001
From: Philip Rebohle <philip.rebohle@tu-dortmund.de>
Date: Sat, 2 May 2020 18:52:35 +0200
Subject: [PATCH] [dxvk] Fix acquire barrier in updateImage

---
 src/dxvk/dxvk_context.cpp | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp
index cdcca55d..899e2d0e 100644
--- a/src/dxvk/dxvk_context.cpp
+++ b/src/dxvk/dxvk_context.cpp
@@ -1966,12 +1966,15 @@ namespace dxvk {
     if (image->isFullSubresource(subresources, imageExtent))
       imageLayoutInitial = VK_IMAGE_LAYOUT_UNDEFINED;
 
-    m_execAcquires.accessImage(
-      image, subresourceRange,
-      imageLayoutInitial, 0, 0,
-      imageLayoutTransfer,
-      VK_PIPELINE_STAGE_TRANSFER_BIT,
-      VK_ACCESS_TRANSFER_WRITE_BIT);
+    if (imageLayoutTransfer != image->info().layout) {
+      m_execAcquires.accessImage(
+        image, subresourceRange,
+        imageLayoutInitial,
+        VK_PIPELINE_STAGE_TRANSFER_BIT, 0,
+        imageLayoutTransfer,
+        VK_PIPELINE_STAGE_TRANSFER_BIT,
+        VK_ACCESS_TRANSFER_WRITE_BIT);
+    }
 
     m_execAcquires.recordCommands(m_cmd);