diff options
author | Samuel Pitoiset <[email protected]> | 2019-05-22 15:38:47 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2019-05-27 13:52:34 +0200 |
commit | 9af15986b0d9ffcb69fcced33e59a61a8c54dfdd (patch) | |
tree | ade19653a3641da993e5b47b758f05c34f46495c /src/amd/vulkan/radv_meta_clear.c | |
parent | 13b38ca1e4341f5f16ae3ee9856552db12fda4cf (diff) |
radv: add radv_clear_htile() helper
This helper will be useful for clearing HTILE after some
depth/stencil resolves.
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_meta_clear.c')
-rw-r--r-- | src/amd/vulkan/radv_meta_clear.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c index 40ecfe001d1..313e80d5cb7 100644 --- a/src/amd/vulkan/radv_meta_clear.c +++ b/src/amd/vulkan/radv_meta_clear.c @@ -1344,6 +1344,18 @@ radv_clear_dcc(struct radv_cmd_buffer *cmd_buffer, image->planes[0].surface.dcc_size, value); } +uint32_t +radv_clear_htile(struct radv_cmd_buffer *cmd_buffer, struct radv_image *image, + const VkImageSubresourceRange *range, uint32_t value) +{ + unsigned layer_count = radv_get_layerCount(image, range); + uint64_t size = image->planes[0].surface.htile_slice_size * layer_count; + uint64_t offset = image->offset + image->htile_offset + + image->planes[0].surface.htile_slice_size * range->baseArrayLayer; + + return radv_fill_buffer(cmd_buffer, image->bo, offset, size, value); +} + static void vi_get_fast_clear_parameters(VkFormat format, const VkClearColorValue *clear_value, uint32_t* reset_value, |