summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_meta_copy.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-11-30 00:26:47 +0000
committerBas Nieuwenhuizen <[email protected]>2016-12-18 20:52:20 +0100
commitef5f59c9a979bbba7f42ba6cadc9dafdcac99380 (patch)
tree420cf279a9efcc2b1a5e3974c6b0b1abdf9335ab /src/amd/vulkan/radv_meta_copy.c
parent983af3a6d11d8d1dcd3c23514f92abceb664642f (diff)
radv: implement image->image copies using compute shader
This is required for having a separate compute queue, we probably can't use this on GFX queue due to DCC. v2: Set coord_components = 2 for itoi texture fetch. (Bas) Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_meta_copy.c')
-rw-r--r--src/amd/vulkan/radv_meta_copy.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/src/amd/vulkan/radv_meta_copy.c b/src/amd/vulkan/radv_meta_copy.c
index 2073a2c77f4..64e0ea8648f 100644
--- a/src/amd/vulkan/radv_meta_copy.c
+++ b/src/amd/vulkan/radv_meta_copy.c
@@ -325,7 +325,8 @@ meta_copy_image(struct radv_cmd_buffer *cmd_buffer,
uint32_t regionCount,
const VkImageCopy *pRegions)
{
- struct radv_meta_saved_state saved_state;
+ bool cs = cmd_buffer->queue_family_index == RADV_QUEUE_COMPUTE;
+ union meta_saved_state saved_state;
/* From the Vulkan 1.0 spec:
*
@@ -333,8 +334,10 @@ meta_copy_image(struct radv_cmd_buffer *cmd_buffer,
* images, but both images must have the same number of samples.
*/
assert(src_image->samples == dest_image->samples);
-
- radv_meta_save_graphics_reset_vport_scissor(&saved_state, cmd_buffer);
+ if (cs)
+ radv_meta_begin_itoi(cmd_buffer, &saved_state.compute);
+ else
+ radv_meta_save_graphics_reset_vport_scissor(&saved_state.gfx, cmd_buffer);
for (unsigned r = 0; r < regionCount; r++) {
assert(pRegions[r].srcSubresource.aspectMask ==
@@ -388,7 +391,10 @@ meta_copy_image(struct radv_cmd_buffer *cmd_buffer,
rect.src_y = src_offset_el.y;
/* Perform Blit */
- radv_meta_blit2d(cmd_buffer, &b_src, NULL, &b_dst, 1, &rect);
+ if (cs)
+ radv_meta_image_to_image_cs(cmd_buffer, &b_src, &b_dst, 1, &rect);
+ else
+ radv_meta_blit2d(cmd_buffer, &b_src, NULL, &b_dst, 1, &rect);
b_src.layer++;
b_dst.layer++;
@@ -399,7 +405,10 @@ meta_copy_image(struct radv_cmd_buffer *cmd_buffer,
}
}
- radv_meta_restore(&saved_state, cmd_buffer);
+ if (cs)
+ radv_meta_end_itoi(cmd_buffer, &saved_state.compute);
+ else
+ radv_meta_restore(&saved_state.gfx, cmd_buffer);
}
void radv_CmdCopyImage(