summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_cmd_buffer.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2018-04-13 19:14:45 +0200
committerSamuel Pitoiset <[email protected]>2018-04-16 14:20:45 +0200
commit6967d32bebf84b715d4fd6dd4a750d1fc75f8991 (patch)
treea67f632c3a288f8d602b6ad6ec249cf8b9c780ba /src/amd/vulkan/radv_cmd_buffer.c
parentc6b1f1c97a2f2b7079a7f9c870903f20ea6de8f0 (diff)
radv: add radv_handle_color_image_transition() helper
To handle CMASK, FMASK and DCC transitions in the same place. Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Niuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_cmd_buffer.c')
-rw-r--r--src/amd/vulkan/radv_cmd_buffer.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index 92c00f5394d..270dcd5a9e0 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -3819,6 +3819,28 @@ static void radv_handle_dcc_image_transition(struct radv_cmd_buffer *cmd_buffer,
}
}
+/**
+ * Handle color image transitions for DCC/FMASK/CMASK.
+ */
+static void radv_handle_color_image_transition(struct radv_cmd_buffer *cmd_buffer,
+ struct radv_image *image,
+ VkImageLayout src_layout,
+ VkImageLayout dst_layout,
+ unsigned src_queue_mask,
+ unsigned dst_queue_mask,
+ const VkImageSubresourceRange *range)
+{
+ if (radv_image_has_dcc(image))
+ radv_handle_dcc_image_transition(cmd_buffer, image, src_layout,
+ dst_layout, src_queue_mask,
+ dst_queue_mask, range);
+
+ if (radv_image_has_cmask(image) || radv_image_has_fmask(image))
+ radv_handle_cmask_image_transition(cmd_buffer, image, src_layout,
+ dst_layout, src_queue_mask,
+ dst_queue_mask, range);
+}
+
static void radv_handle_image_transition(struct radv_cmd_buffer *cmd_buffer,
struct radv_image *image,
VkImageLayout src_layout,
@@ -3854,15 +3876,9 @@ static void radv_handle_image_transition(struct radv_cmd_buffer *cmd_buffer,
dst_queue_mask, range,
pending_clears);
- if (radv_image_has_dcc(image))
- radv_handle_dcc_image_transition(cmd_buffer, image, src_layout,
- dst_layout, src_queue_mask,
- dst_queue_mask, range);
-
- if (radv_image_has_cmask(image) || radv_image_has_fmask(image))
- radv_handle_cmask_image_transition(cmd_buffer, image, src_layout,
- dst_layout, src_queue_mask,
- dst_queue_mask, range);
+ radv_handle_color_image_transition(cmd_buffer, image, src_layout,
+ dst_layout, src_queue_mask,
+ dst_queue_mask, range);
}
void radv_CmdPipelineBarrier(