From: Samuel Pitoiset Date: Fri, 27 Jul 2018 14:14:28 +0000 (+0200) Subject: radv/gfx9: implement coherent shaders for VK_ACCESS_SHADER_READ_BIT X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=87fbc16e3485306adfc625aafac1d04c58f7df22;p=mesa.git radv/gfx9: implement coherent shaders for VK_ACCESS_SHADER_READ_BIT Single-sample color and single-sample depth (not stencil) are coherent with shaders. Signed-off-by: Samuel Pitoiset Reviewed-by: Bas Nieuwenhuizen device->physical_device->rad_info.chip_class >= GFX9) { + if (image->info.samples == 1 && + (image->usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT | + VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) && + !vk_format_is_stencil(image->vk_format)) { + /* Single-sample color and single-sample depth + * (not stencil) are coherent with shaders on + * GFX9. + */ + image_is_coherent = true; + } + } } for_each_bit(b, dst_flags) { @@ -2045,12 +2059,17 @@ 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_VERTEX_ATTRIBUTE_READ_BIT: - case VK_ACCESS_SHADER_READ_BIT: case VK_ACCESS_TRANSFER_READ_BIT: case VK_ACCESS_INPUT_ATTACHMENT_READ_BIT: flush_bits |= RADV_CMD_FLAG_INV_VMEM_L1 | RADV_CMD_FLAG_INV_GLOBAL_L2; break; + case VK_ACCESS_SHADER_READ_BIT: + flush_bits |= RADV_CMD_FLAG_INV_VMEM_L1; + + if (!image_is_coherent) + flush_bits |= RADV_CMD_FLAG_INV_GLOBAL_L2; + break; case VK_ACCESS_COLOR_ATTACHMENT_READ_BIT: if (flush_CB) flush_bits |= RADV_CMD_FLAG_FLUSH_AND_INV_CB;