From 924fbfc9a1fc46a3698fa23649e6dccc3e3e6782 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 3 Dec 2015 11:05:52 -0800 Subject: [PATCH] vk/0.210.0: Fix how we handle access flags in barriers The initial implementation in the 0.210.0 API update was misguieded as to what the access flags meant. This should be more correct. --- src/vulkan/genX_cmd_buffer.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/vulkan/genX_cmd_buffer.c b/src/vulkan/genX_cmd_buffer.c index e404d5efa9e..ac1ab822b49 100644 --- a/src/vulkan/genX_cmd_buffer.c +++ b/src/vulkan/genX_cmd_buffer.c @@ -223,10 +223,11 @@ void genX(CmdPipelineBarrier)( } } - for_each_bit(b, dst_flags) { + /* The src flags represent how things were used previously. This is + * what we use for doing flushes. + */ + for_each_bit(b, src_flags) { switch ((VkAccessFlagBits)(1 << b)) { - case VK_ACCESS_HOST_WRITE_BIT: - break; /* FIXME: Little-core systems */ case VK_ACCESS_SHADER_WRITE_BIT: cmd.DCFlushEnable = true; break; @@ -241,14 +242,16 @@ void genX(CmdPipelineBarrier)( cmd.DepthCacheFlushEnable = true; break; default: - assert(!"Not a write bit"); + /* Doesn't require a flush */ + break; } } - for_each_bit(b, src_flags) { + /* The dst flags represent how things will be used in the fugure. This + * is what we use for doing cache invalidations. + */ + for_each_bit(b, dst_flags) { switch ((VkAccessFlagBits)(1 << b)) { - case VK_ACCESS_HOST_READ_BIT: - break; /* FIXME: Little-core systems */ case VK_ACCESS_INDIRECT_COMMAND_READ_BIT: case VK_ACCESS_INDEX_READ_BIT: case VK_ACCESS_VERTEX_ATTRIBUTE_READ_BIT: @@ -258,22 +261,19 @@ void genX(CmdPipelineBarrier)( cmd.ConstantCacheInvalidationEnable = true; /* fallthrough */ case VK_ACCESS_SHADER_READ_BIT: - cmd.DCFlushEnable = true; cmd.TextureCacheInvalidationEnable = true; break; case VK_ACCESS_COLOR_ATTACHMENT_READ_BIT: cmd.TextureCacheInvalidationEnable = true; break; - case VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT: - cmd.DCFlushEnable = true; - break; case VK_ACCESS_TRANSFER_READ_BIT: cmd.TextureCacheInvalidationEnable = true; break; case VK_ACCESS_MEMORY_READ_BIT: break; /* XXX: What is this? */ default: - assert(!"Not a read bit"); + /* Doesn't require a flush */ + break; } } -- 2.30.2