radv: Invalidate the correct caches for CB/DB dst barriers.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Wed, 8 Mar 2017 20:31:53 +0000 (21:31 +0100)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Thu, 9 Mar 2017 01:35:01 +0000 (02:35 +0100)
Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/radv_cmd_buffer.c

index 07d0a0c2c12e9b17126d021a9fe3df37fde4eb46..088a3c9025cda91bdec09a973e353757ae520046 100644 (file)
@@ -1497,13 +1497,19 @@ radv_dst_access_flush(struct radv_cmd_buffer *cmd_buffer,
                        flush_bits |= RADV_CMD_FLAG_INV_VMEM_L1 | RADV_CMD_FLAG_INV_SMEM_L1;
                        break;
                case VK_ACCESS_SHADER_READ_BIT:
-                       flush_bits |= RADV_CMD_FLAG_INV_GLOBAL_L2;
-                       break;
-               case VK_ACCESS_COLOR_ATTACHMENT_READ_BIT:
                case VK_ACCESS_TRANSFER_READ_BIT:
-               case VK_ACCESS_TRANSFER_WRITE_BIT:
                case VK_ACCESS_INPUT_ATTACHMENT_READ_BIT:
-                       flush_bits |= RADV_CMD_FLUSH_AND_INV_FRAMEBUFFER | RADV_CMD_FLAG_INV_GLOBAL_L2;
+                       flush_bits |= RADV_CMD_FLAG_INV_VMEM_L1 |
+                                     RADV_CMD_FLAG_INV_GLOBAL_L2;
+                       break;
+               case VK_ACCESS_COLOR_ATTACHMENT_READ_BIT:
+                       flush_bits |= RADV_CMD_FLAG_FLUSH_AND_INV_CB |
+                                     RADV_CMD_FLAG_FLUSH_AND_INV_CB_META;
+                       break;
+               case VK_ACCESS_DEPTH_STENCIL_ATTACHMENT_READ_BIT:
+                       flush_bits |= RADV_CMD_FLAG_FLUSH_AND_INV_DB |
+                                     RADV_CMD_FLAG_FLUSH_AND_INV_DB_META;
+                       break;
                default:
                        break;
                }