Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Impeller] Correct attachment description for offscreen MSAA resolve. #42753

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion impeller/renderer/backend/vulkan/formats_vk.h
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ constexpr vk::AttachmentDescription CreateAttachmentDescription(
switch (kind) {
case AttachmentKind::kColor:
vk_attachment.initialLayout = current_layout;
vk_attachment.finalLayout = vk::ImageLayout::eColorAttachmentOptimal;
vk_attachment.finalLayout = vk::ImageLayout::eGeneral;
break;
case AttachmentKind::kDepth:
case AttachmentKind::kStencil:
Expand Down
7 changes: 4 additions & 3 deletions impeller/renderer/backend/vulkan/render_pass_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ static vk::AttachmentDescription CreateAttachmentDescription(

if (desc.storage_mode == StorageMode::kDeviceTransient) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the real problem that we're setting the storage mode to device transient?

I'm not quite clear on when we should set dontcare or not though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no that doesn't seem to be it, at least things are already working for me

store_action = StoreAction::kDontCare;
} else if (resolve_texture) {
store_action = StoreAction::kStore;
}

const auto attachment_desc =
Expand Down Expand Up @@ -93,9 +95,8 @@ SharedHandleVK<vk::RenderPass> RenderPassVK::CreateVKRenderPass(
vk::ImageLayout::eColorAttachmentOptimal};
attachments.emplace_back(CreateAttachmentDescription(color));
if (color.resolve_texture) {
resolve_refs[bind_point] =
vk::AttachmentReference{static_cast<uint32_t>(attachments.size()),
vk::ImageLayout::eColorAttachmentOptimal};
resolve_refs[bind_point] = vk::AttachmentReference{
static_cast<uint32_t>(attachments.size()), vk::ImageLayout::eGeneral};
attachments.emplace_back(CreateAttachmentDescription(color, true));
}
}
Expand Down