summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>2020-10-14 03:45:23 +0200
committerMarge Bot <eric+marge@anholt.net>2021-01-13 16:27:19 +0000
commit9026f10cdadff9d485dfd64654407518c6497c50 (patch)
treecea7273b9aa542c9aa9696014dc6a463a9a96722 /src
parent3d7713b5a25f3efd1434c7b6ba5ee28af7cac3ce (diff)
radv: Invalidate CB on SHADER_WRITE for meta operations.
To cancel the optimization in radv_dst_access_flush if these helpers get used by meta operations. We could also remove that optimization but I think this triggers less often as all SHADER_WRITE flushes on images not supporting STORAGE should be meta Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7202>
Diffstat (limited to 'src')
-rw-r--r--src/amd/vulkan/radv_cmd_buffer.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 471711ebf6f..2a09d2bb700 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -3286,6 +3286,18 @@ radv_src_access_flush(struct radv_cmd_buffer *cmd_buffer,
for_each_bit(b, src_flags) {
switch ((VkAccessFlagBits)(1 << b)) {
case VK_ACCESS_SHADER_WRITE_BIT:
+ /* since the STORAGE bit isn't set we know that this is a meta operation.
+ * on the dst flush side we skip CB/DB flushes without the STORAGE bit, so
+ * set it here. */
+ if (image && !(image->usage & VK_IMAGE_USAGE_STORAGE_BIT)) {
+ if (vk_format_is_depth_or_stencil(image->vk_format)) {
+ flush_bits |= RADV_CMD_FLAG_FLUSH_AND_INV_DB;
+ } else {
+ flush_bits |= RADV_CMD_FLAG_FLUSH_AND_INV_CB;
+ }
+ }
+ flush_bits |= RADV_CMD_FLAG_WB_L2;
+ break;
case VK_ACCESS_TRANSFORM_FEEDBACK_WRITE_BIT_EXT:
case VK_ACCESS_TRANSFORM_FEEDBACK_COUNTER_WRITE_BIT_EXT:
flush_bits |= RADV_CMD_FLAG_WB_L2;