[gtk/gbsneto/vulkan-fixes: 1/3] vulkan/image: Set HOST and TRANSFER bits for before barriers



commit 422a9e33fd01a6a02b61e2996a7fef27c30a830a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Oct 4 11:52:43 2019 -0300

    vulkan/image: Set HOST and TRANSFER bits for before barriers
    
    Multiple images in the before barrier array are defined with
    VK_ACCESS_TRANSFER_WRITE_BIT and VK_ACCESS_TRANSFER_READ_BIT,
    which requires passing VK_PIPELINE_STAGE_TRANSFER_BIT and
    VK_PIPELINE_STAGE_HOST_BIT to vkCmdPipelineBarrier().
    
    Pass these flags correctly.

 gsk/vulkan/gskvulkanimage.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/gsk/vulkan/gskvulkanimage.c b/gsk/vulkan/gskvulkanimage.c
index 03d76c2d05..64e780bb7f 100644
--- a/gsk/vulkan/gskvulkanimage.c
+++ b/gsk/vulkan/gskvulkanimage.c
@@ -142,13 +142,15 @@ gsk_vulkan_uploader_get_copy_buffer (GskVulkanUploader *self)
 void
 gsk_vulkan_uploader_upload (GskVulkanUploader *self)
 {
+  VkPipelineStageFlagBits host_and_transfer_bits = VK_PIPELINE_STAGE_HOST_BIT | 
VK_PIPELINE_STAGE_TRANSFER_BIT;
+
   if (self->before_buffer_barriers->len > 0 || self->before_image_barriers->len > 0)
     {
       VkCommandBuffer command_buffer;
 
       command_buffer = gsk_vulkan_command_pool_get_buffer (self->command_pool);
       vkCmdPipelineBarrier (command_buffer,
-                            VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | 
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT,
+                            VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT | 
VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT | host_and_transfer_bits,
                             VK_PIPELINE_STAGE_HOST_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT,
                             0,
                             0, NULL,
@@ -164,7 +166,7 @@ gsk_vulkan_uploader_upload (GskVulkanUploader *self)
     {
       VkCommandBuffer command_buffer = gsk_vulkan_uploader_get_copy_buffer (self);
       vkCmdPipelineBarrier (command_buffer,
-                            VK_PIPELINE_STAGE_HOST_BIT | VK_PIPELINE_STAGE_TRANSFER_BIT,
+                            host_and_transfer_bits,
                             VK_PIPELINE_STAGE_FRAGMENT_SHADER_BIT,
                             0,
                             0, NULL,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]