diff options
author | Bas Nieuwenhuizen <[email protected]> | 2017-12-25 14:27:28 +0100 |
---|---|---|
committer | Bas Nieuwenhuizen <[email protected]> | 2017-12-28 00:26:07 +0100 |
commit | cebc9a119d44cb5b2b3bd5e262452e112b75fea2 (patch) | |
tree | 802dde496d54ff93390aa4f510e525462d69a929 /src | |
parent | c39947ce3046d4339305f2bcecba2617b90edb71 (diff) |
radv: Flush caches before subpass resolve.
Fixes: f4e499ec791 "radv: add initial non-conformant radv vulkan driver"
Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/amd/vulkan/radv_meta_resolve_cs.c | 8 | ||||
-rw-r--r-- | src/amd/vulkan/radv_meta_resolve_fs.c | 10 |
2 files changed, 18 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_meta_resolve_cs.c b/src/amd/vulkan/radv_meta_resolve_cs.c index 3833faa1247..5b6cea6c103 100644 --- a/src/amd/vulkan/radv_meta_resolve_cs.c +++ b/src/amd/vulkan/radv_meta_resolve_cs.c @@ -487,6 +487,14 @@ radv_cmd_buffer_resolve_subpass_cs(struct radv_cmd_buffer *cmd_buffer) if (!subpass->has_resolve) return; + /* Resolves happen before the end-of-subpass barriers get executed, + * so we have to make the attachment shader-readable */ + cmd_buffer->state.flush_bits |= RADV_CMD_FLAG_PS_PARTIAL_FLUSH | + RADV_CMD_FLAG_FLUSH_AND_INV_CB | + RADV_CMD_FLAG_FLUSH_AND_INV_CB_META | + RADV_CMD_FLAG_INV_GLOBAL_L2 | + RADV_CMD_FLAG_INV_VMEM_L1; + for (uint32_t i = 0; i < subpass->color_count; ++i) { VkAttachmentReference src_att = subpass->color_attachments[i]; VkAttachmentReference dest_att = subpass->resolve_attachments[i]; diff --git a/src/amd/vulkan/radv_meta_resolve_fs.c b/src/amd/vulkan/radv_meta_resolve_fs.c index c25aea73670..756309efd2e 100644 --- a/src/amd/vulkan/radv_meta_resolve_fs.c +++ b/src/amd/vulkan/radv_meta_resolve_fs.c @@ -604,6 +604,16 @@ radv_cmd_buffer_resolve_subpass_fs(struct radv_cmd_buffer *cmd_buffer) RADV_META_SAVE_CONSTANTS | RADV_META_SAVE_DESCRIPTORS); + /* Resolves happen before the end-of-subpass barriers get executed, + * so we have to make the attachment shader-readable */ + cmd_buffer->state.flush_bits |= RADV_CMD_FLAG_PS_PARTIAL_FLUSH | + RADV_CMD_FLAG_FLUSH_AND_INV_CB | + RADV_CMD_FLAG_FLUSH_AND_INV_CB_META | + RADV_CMD_FLAG_FLUSH_AND_INV_DB | + RADV_CMD_FLAG_FLUSH_AND_INV_DB_META | + RADV_CMD_FLAG_INV_GLOBAL_L2 | + RADV_CMD_FLAG_INV_VMEM_L1; + for (uint32_t i = 0; i < subpass->color_count; ++i) { VkAttachmentReference src_att = subpass->color_attachments[i]; VkAttachmentReference dest_att = subpass->resolve_attachments[i]; |