Commit 6ff88a82 authored by Bas Nieuwenhuizen's avatar Bas Nieuwenhuizen Committed by Marge Bot
Browse files

radv: Add retiling for foreign queues.



This way modifier images that don't go through the present layout
get the retile executed properly.
Reviewed-by: Samuel Pitoiset's avatarSamuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <!9998>
parent dece117f
......@@ -6390,6 +6390,17 @@ static void radv_init_color_image_metadata(struct radv_cmd_buffer *cmd_buffer,
cmd_buffer->state.flush_bits |= flush_bits;
}
static void radv_retile_transition(struct radv_cmd_buffer *cmd_buffer,
struct radv_image *image,
VkImageLayout src_layout,
VkImageLayout dst_layout,
unsigned dst_queue_mask)
{
if (src_layout != VK_IMAGE_LAYOUT_PRESENT_SRC_KHR &&
(dst_layout == VK_IMAGE_LAYOUT_PRESENT_SRC_KHR ||
(dst_queue_mask & (1u << RADV_QUEUE_FOREIGN))))
radv_retile_dcc(cmd_buffer, image);
}
/**
* Handle color image transitions for DCC/FMASK/CMASK.
*/
......@@ -6417,9 +6428,8 @@ static void radv_handle_color_image_transition(struct radv_cmd_buffer *cmd_buffe
src_queue_mask, dst_queue_mask,
range);
if (dst_layout == VK_IMAGE_LAYOUT_PRESENT_SRC_KHR &&
image->retile_map)
radv_retile_dcc(cmd_buffer, image);
if (image->retile_map)
radv_retile_transition(cmd_buffer, image, src_layout, dst_layout, dst_queue_mask);
return;
}
......@@ -6439,10 +6449,8 @@ static void radv_handle_color_image_transition(struct radv_cmd_buffer *cmd_buffe
fast_clear_flushed = true;
}
if (src_layout != VK_IMAGE_LAYOUT_PRESENT_SRC_KHR &&
dst_layout == VK_IMAGE_LAYOUT_PRESENT_SRC_KHR &&
image->retile_map)
radv_retile_dcc(cmd_buffer, image);
if (image->retile_map)
radv_retile_transition(cmd_buffer, image, src_layout, dst_layout, dst_queue_mask);
} else if (radv_image_has_cmask(image) || radv_image_has_fmask(image)) {
if (radv_layout_can_fast_clear(cmd_buffer->device, image, src_layout,
src_render_loop, src_queue_mask) &&
......
......@@ -2166,7 +2166,8 @@ unsigned radv_image_queue_family_mask(const struct radv_image *image, uint32_t f
return image->queue_family_mask;
if (family == VK_QUEUE_FAMILY_EXTERNAL ||
family == VK_QUEUE_FAMILY_FOREIGN_EXT)
return (1u << RADV_MAX_QUEUE_FAMILIES) - 1u;
return ((1u << RADV_MAX_QUEUE_FAMILIES) - 1u) |
(1u << RADV_QUEUE_FOREIGN);
if (family == VK_QUEUE_FAMILY_IGNORED)
return 1u << queue_family;
return 1u << family;
......
......@@ -662,6 +662,9 @@ struct radv_meta_state {
#define RADV_QUEUE_COMPUTE 1
#define RADV_QUEUE_TRANSFER 2
/* Not a real queue family */
#define RADV_QUEUE_FOREIGN 3
#define RADV_MAX_QUEUE_FAMILIES 3
#define RADV_NUM_HW_CTX (RADEON_CTX_PRIORITY_REALTIME + 1)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment