summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2019-07-01 16:30:59 +0200
committerSamuel Pitoiset <[email protected]>2019-07-02 09:37:56 +0200
commite41e575e24757227579a7190a5cff211ca65ed0b (patch)
tree6f0fa18666b4449453dbf2176e1019ba18bae73d /src
parente47c68b7b0566150d85e84c1a9c0fa268d7278c8 (diff)
radv: implement clearing DCC layers on GFX8
Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/amd/vulkan/radv_cmd_buffer.c6
-rw-r--r--src/amd/vulkan/radv_meta_clear.c5
2 files changed, 7 insertions, 4 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 1f3fdd1abd0..fc8184200fc 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -4968,11 +4968,13 @@ void radv_initialize_dcc(struct radv_cmd_buffer *cmd_buffer,
for (unsigned i = 0; i < image->planes[0].surface.num_dcc_levels; i++) {
struct legacy_surf_level *surf_level =
&image->planes[0].surface.u.legacy.level[i];
+ unsigned dcc_fast_clear_size =
+ surf_level->dcc_slice_fast_clear_size * image->info.array_size;
- if (!surf_level->dcc_fast_clear_size)
+ if (!dcc_fast_clear_size)
break;
- size = surf_level->dcc_offset + surf_level->dcc_fast_clear_size;
+ size = surf_level->dcc_offset + dcc_fast_clear_size;
}
/* Initialize the mipmap levels without DCC. */
diff --git a/src/amd/vulkan/radv_meta_clear.c b/src/amd/vulkan/radv_meta_clear.c
index e5181daf0f2..08d9ea3e1db 100644
--- a/src/amd/vulkan/radv_meta_clear.c
+++ b/src/amd/vulkan/radv_meta_clear.c
@@ -1397,8 +1397,9 @@ radv_clear_dcc(struct radv_cmd_buffer *cmd_buffer,
* fast clear path fallbacks to slow clears if one
* level can't be fast cleared.
*/
- offset += surf_level->dcc_offset;
- size = surf_level->dcc_fast_clear_size;
+ offset += surf_level->dcc_offset +
+ surf_level->dcc_slice_fast_clear_size * range->baseArrayLayer;
+ size = surf_level->dcc_slice_fast_clear_size * radv_get_layerCount(image, range);
}
flush_bits |= radv_fill_buffer(cmd_buffer, image->bo, offset,