radv: flush DB cache before and after HTILE decompress.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 27 Mar 2017 23:48:15 +0000 (01:48 +0200)
committerBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Tue, 28 Mar 2017 00:51:40 +0000 (02:51 +0200)
It reads @ writes the DB cache, and we haven't flushed dst caches yet,
so DB cache may be stale. Also the user might be shader read (and probably is),
so also flush after.

Signed-off-by: Bas Nieuwenhuizen <basni@google.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
CC: <mesa-stable@lists.freedesktop.org>
Fixes: f4e499ec791 ("radv: add initial non-conformant radv vulkan driver")
src/amd/vulkan/radv_cmd_buffer.c

index d3397a0e000b0d36b14740bd33a3c4495b639439..1b13ae7bc64d75abd2c54b44b7bc5af90d756012 100644 (file)
@@ -2771,7 +2771,13 @@ static void radv_handle_depth_image_transition(struct radv_cmd_buffer *cmd_buffe
                local_range.baseMipLevel = 0;
                local_range.levelCount = 1;
 
+               cmd_buffer->state.flush_bits |= RADV_CMD_FLAG_FLUSH_AND_INV_DB |
+                                               RADV_CMD_FLAG_FLUSH_AND_INV_DB_META;
+
                radv_decompress_depth_image_inplace(cmd_buffer, image, &local_range);
+
+               cmd_buffer->state.flush_bits |= RADV_CMD_FLAG_FLUSH_AND_INV_DB |
+                                               RADV_CMD_FLAG_FLUSH_AND_INV_DB_META;
        }
 }