anv: Handle color layout transitions from the UNINITIALIZED layout
This causes dEQP-VK.api.copy_and_blit.resolve_image.partial.* to start failing due to test bugs. See CL 1031 for a test fix. Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Cc: "17.1" <mesa-stable@lists.freedesktop.org>
This commit is contained in:
@@ -388,6 +388,25 @@ transition_depth_buffer(struct anv_cmd_buffer *cmd_buffer,
|
||||
anv_gen8_hiz_op_resolve(cmd_buffer, image, hiz_op);
|
||||
}
|
||||
|
||||
static void
|
||||
transition_color_buffer(struct anv_cmd_buffer *cmd_buffer,
|
||||
const struct anv_image *image,
|
||||
VkImageLayout initial_layout,
|
||||
VkImageLayout final_layout,
|
||||
const struct isl_view *view,
|
||||
const VkImageSubresourceRange *subresourceRange)
|
||||
{
|
||||
if (image->aux_usage != ISL_AUX_USAGE_CCS_E)
|
||||
return;
|
||||
|
||||
if (initial_layout != VK_IMAGE_LAYOUT_UNDEFINED &&
|
||||
initial_layout != VK_IMAGE_LAYOUT_PREINITIALIZED)
|
||||
return;
|
||||
|
||||
#if GEN_GEN >= 9
|
||||
anv_image_ccs_clear(cmd_buffer, image, view, subresourceRange);
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* Setup anv_cmd_state::attachments for vkCmdBeginRenderPass.
|
||||
@@ -976,6 +995,14 @@ void genX(CmdPipelineBarrier)(
|
||||
pImageMemoryBarriers[i].oldLayout,
|
||||
pImageMemoryBarriers[i].newLayout);
|
||||
}
|
||||
if (pImageMemoryBarriers[i].subresourceRange.aspectMask &
|
||||
VK_IMAGE_ASPECT_COLOR_BIT) {
|
||||
transition_color_buffer(cmd_buffer, image,
|
||||
pImageMemoryBarriers[i].oldLayout,
|
||||
pImageMemoryBarriers[i].newLayout,
|
||||
NULL,
|
||||
&pImageMemoryBarriers[i].subresourceRange);
|
||||
}
|
||||
}
|
||||
|
||||
cmd_buffer->state.pending_pipe_bits |=
|
||||
@@ -2448,8 +2475,9 @@ cmd_buffer_subpass_transition_layouts(struct anv_cmd_buffer * const cmd_buffer,
|
||||
*/
|
||||
assert(att_ref->attachment < cmd_state->framebuffer->attachment_count);
|
||||
|
||||
const struct anv_image * const image =
|
||||
cmd_state->framebuffer->attachments[att_ref->attachment]->image;
|
||||
const struct anv_image_view * const iview =
|
||||
cmd_state->framebuffer->attachments[att_ref->attachment];
|
||||
const struct anv_image * const image = iview->image;
|
||||
|
||||
/* Perform the layout transition. */
|
||||
if (image->aspects & VK_IMAGE_ASPECT_DEPTH_BIT) {
|
||||
@@ -2459,6 +2487,11 @@ cmd_buffer_subpass_transition_layouts(struct anv_cmd_buffer * const cmd_buffer,
|
||||
anv_layout_to_aux_usage(&cmd_buffer->device->info, image,
|
||||
image->aspects, target_layout);
|
||||
}
|
||||
if (image->aspects & VK_IMAGE_ASPECT_COLOR_BIT) {
|
||||
transition_color_buffer(cmd_buffer, image,
|
||||
att_state->current_layout, target_layout,
|
||||
&iview->isl, NULL);
|
||||
}
|
||||
|
||||
att_state->current_layout = target_layout;
|
||||
}
|
||||
|
Reference in New Issue
Block a user