Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Closed
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
20 changes: 10 additions & 10 deletions impeller/renderer/backend/vulkan/render_pass_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,6 @@
#include "impeller/renderer/backend/vulkan/sampler_vk.h"
#include "impeller/renderer/backend/vulkan/shared_object_vk.h"
#include "impeller/renderer/backend/vulkan/texture_vk.h"
#include "vulkan/vulkan.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

Incorrect includes.

#include "vulkan/vulkan_handles.hpp"

namespace impeller {

Expand Down Expand Up @@ -91,15 +89,8 @@ SharedHandleVK<vk::RenderPass> RenderPassVK::CreateVKRenderPass(
attachment.texture->GetTextureDescriptor().format, //
attachment.texture->GetTextureDescriptor().sample_count, //
attachment.load_action, //
attachment.store_action, //
TextureVK::Cast(*attachment.texture).GetLayout() //
attachment.store_action //
);
TextureVK::Cast(*attachment.texture)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since the render pass is cached and reused, these calls to SetLayoutWithoutEncoding were only running the first time. I moved them into the constructor so they correctly run each time.

This could be the cause of other bugs, as it could leave our own book keeping out of sync with the actual image layout.

.SetLayoutWithoutEncoding(vk::ImageLayout::eGeneral);
if (attachment.resolve_texture) {
TextureVK::Cast(*attachment.resolve_texture)
.SetLayoutWithoutEncoding(vk::ImageLayout::eGeneral);
}
return true;
});

Expand Down Expand Up @@ -202,6 +193,15 @@ RenderPassVK::RenderPassVK(const std::shared_ptr<const Context>& context,
pass_info.setPClearValues(clears.data());
pass_info.setClearValueCount(clear_count);

if (resolve_image_vk_) {
TextureVK::Cast(*resolve_image_vk_)
.SetLayoutWithoutEncoding(vk::ImageLayout::eGeneral);
}
if (color_image_vk_) {
TextureVK::Cast(*color_image_vk_)
.SetLayoutWithoutEncoding(vk::ImageLayout::eGeneral);
}

command_buffer_vk_.beginRenderPass(pass_info, vk::SubpassContents::eInline);

// Set the initial viewport.
Expand Down
1 change: 0 additions & 1 deletion impeller/renderer/backend/vulkan/render_pass_vk.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
#include "impeller/renderer/command_buffer.h"
#include "impeller/renderer/render_pass.h"
#include "impeller/renderer/render_target.h"
#include "vulkan/vulkan_handles.hpp"
Copy link
Contributor

Choose a reason for hiding this comment

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

Incorrect includes.


namespace impeller {

Expand Down
Loading