From 0bc249857097b4c3226cbdc8dc25a898a57e8b35 Mon Sep 17 00:00:00 2001 From: Philip Rebohle Date: Thu, 13 Dec 2018 22:42:36 +0100 Subject: [PATCH] [dxvk] Relax compute shader barriers for read-only storage buffers --- src/dxvk/dxvk_context.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/dxvk/dxvk_context.cpp b/src/dxvk/dxvk_context.cpp index 668dc5e7..b6078830 100644 --- a/src/dxvk/dxvk_context.cpp +++ b/src/dxvk/dxvk_context.cpp @@ -3123,7 +3123,8 @@ namespace dxvk { switch (binding.type) { case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: - access.set(DxvkAccess::Write); + if (binding.access & VK_ACCESS_SHADER_WRITE_BIT) + access.set(DxvkAccess::Write); /* fall through */ case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: @@ -3133,7 +3134,8 @@ namespace dxvk { break; case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: - access.set(DxvkAccess::Write); + if (binding.access & VK_ACCESS_SHADER_WRITE_BIT) + access.set(DxvkAccess::Write); /* fall through */ case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: @@ -3142,7 +3144,8 @@ namespace dxvk { break; case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: - access.set(DxvkAccess::Write); + if (binding.access & VK_ACCESS_SHADER_WRITE_BIT) + access.set(DxvkAccess::Write); /* fall through */ case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE: @@ -3177,7 +3180,8 @@ namespace dxvk { switch (binding.type) { case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER: case VK_DESCRIPTOR_TYPE_STORAGE_BUFFER_DYNAMIC: - access |= VK_ACCESS_SHADER_WRITE_BIT; + if (binding.access & VK_ACCESS_SHADER_WRITE_BIT) + access |= VK_ACCESS_SHADER_WRITE_BIT; /* fall through */ case VK_DESCRIPTOR_TYPE_UNIFORM_BUFFER: @@ -3190,7 +3194,8 @@ namespace dxvk { break; case VK_DESCRIPTOR_TYPE_STORAGE_TEXEL_BUFFER: - access |= VK_ACCESS_SHADER_WRITE_BIT; + if (binding.access & VK_ACCESS_SHADER_WRITE_BIT) + access |= VK_ACCESS_SHADER_WRITE_BIT; /* fall through */ case VK_DESCRIPTOR_TYPE_UNIFORM_TEXEL_BUFFER: @@ -3202,7 +3207,8 @@ namespace dxvk { break; case VK_DESCRIPTOR_TYPE_STORAGE_IMAGE: - access |= VK_ACCESS_SHADER_WRITE_BIT; + if (binding.access & VK_ACCESS_SHADER_WRITE_BIT) + access |= VK_ACCESS_SHADER_WRITE_BIT; /* fall through */ case VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE: