[Mlir-commits] [mlir] acb7827 - [mlir][vulkan-runner] Fix buffer usage flags

Kevin Petit llvmlistbot at llvm.org
Wed Oct 14 08:29:50 PDT 2020


Author: Kevin Petit
Date: 2020-10-14T16:29:32+01:00
New Revision: acb7827d6217000541c5c0ce2b03049e4f49d23f

URL: https://github.com/llvm/llvm-project/commit/acb7827d6217000541c5c0ce2b03049e4f49d23f
DIFF: https://github.com/llvm/llvm-project/commit/acb7827d6217000541c5c0ce2b03049e4f49d23f.diff

LOG: [mlir][vulkan-runner] Fix buffer usage flags

The buffers are used as source or destination of transfer commands
so always add VK_BUFFER_USAGE_TRANSFER_{DST,SRC}_BIT to their usage
flags.

Signed-off-by: Kevin Petit <kevin.petit at arm.com>

Added: 
    

Modified: 
    mlir/tools/mlir-vulkan-runner/VulkanRuntime.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/tools/mlir-vulkan-runner/VulkanRuntime.cpp b/mlir/tools/mlir-vulkan-runner/VulkanRuntime.cpp
index 42f8be45135b..649d731fc16c 100644
--- a/mlir/tools/mlir-vulkan-runner/VulkanRuntime.cpp
+++ b/mlir/tools/mlir-vulkan-runner/VulkanRuntime.cpp
@@ -452,7 +452,8 @@ LogicalResult VulkanRuntime::createMemoryBuffers() {
       bufferCreateInfo.pNext = nullptr;
       bufferCreateInfo.flags = 0;
       bufferCreateInfo.size = bufferSize;
-      bufferCreateInfo.usage = bufferUsage;
+      bufferCreateInfo.usage = bufferUsage | VK_BUFFER_USAGE_TRANSFER_DST_BIT |
+                               VK_BUFFER_USAGE_TRANSFER_SRC_BIT;
       bufferCreateInfo.sharingMode = VK_SHARING_MODE_EXCLUSIVE;
       bufferCreateInfo.queueFamilyIndexCount = 1;
       bufferCreateInfo.pQueueFamilyIndices = &queueFamilyIndex;


        


More information about the Mlir-commits mailing list