Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from 1 commit
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/core/host_buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
namespace impeller {

/// Approximately the same size as the max frames in flight.
static const constexpr size_t kHostBufferArenaSize = 3u;
static const constexpr size_t kHostBufferArenaSize = 4u;

/// The host buffer class manages one more 1024 Kb blocks of device buffer
/// allocations.
Expand Down
5 changes: 4 additions & 1 deletion impeller/entity/contents/host_buffer_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,10 @@ TEST_P(HostBufferTest, ResetIncrementsFrameCounter) {
EXPECT_EQ(buffer->GetStateForTest().current_frame, 2u);

buffer->Reset();
EXPECT_EQ(buffer->GetStateForTest().current_frame, 0u);
EXPECT_EQ(buffer->GetStateForTest().current_frame, 3u);

buffer->Reset();
EXPECT_EQ(buffer->GetStateForTest().current_frame, 4u);
}

TEST_P(HostBufferTest,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include "impeller/renderer/backend/vulkan/swapchain/surface_vk.h"
#include "impeller/toolkit/android/surface_transaction.h"
#include "impeller/toolkit/android/surface_transaction_stats.h"
#include "vulkan/vulkan_to_string.hpp"

namespace impeller {

Expand Down Expand Up @@ -111,20 +112,21 @@ std::unique_ptr<Surface> AHBSwapchainImplVK::AcquireNextDrawable() {
return nullptr;
}

auto context = transients_->GetContext().lock();
if (context) {
ContextVK::Cast(*context).GetGPUTracer()->MarkFrameStart();
}

// Ask the GPU to wait for the render ready semaphore to be signaled before
// performing rendering operations.
if (!SubmitWaitForRenderReady(pool_entry.render_ready_fence,
pool_entry.texture)) {
VALIDATION_LOG << "Could not submit a command to the GPU to wait on render "
"readiness.";
VALIDATION_LOG << "Could wait on render ready fence.";
return nullptr;
}

#if IMPELLER_DEBUG
auto context = transients_->GetContext().lock();
if (context) {
ContextVK::Cast(*context).GetGPUTracer()->MarkFrameStart();
}
#endif // IMPELLER_DEBUG

auto surface = SurfaceVK::WrapSwapchainImage(
transients_, pool_entry.texture,
[signaler = auto_sema_signaler, weak = weak_from_this(),
Expand Down Expand Up @@ -154,10 +156,12 @@ bool AHBSwapchainImplVK::Present(
return false;
}

#if IMPELLER_DEBUG
auto context = transients_->GetContext().lock();
if (context) {
ContextVK::Cast(*context).GetGPUTracer()->MarkFrameEnd();
}
#endif // IMPELLER_DEBUG

if (!texture) {
return false;
Expand Down Expand Up @@ -308,8 +312,8 @@ bool AHBSwapchainImplVK::SubmitWaitForRenderReady(
);

if (!(result == vk::Result::eSuccess || result == vk::Result::eTimeout)) {
VALIDATION_LOG << "Fence waiter encountered an unexpected error. Tearing "
"down the waiter thread.";
VALIDATION_LOG << "Encountered error while waiting on swapchain image: "
<< vk::to_string(result);
return false;
}

Expand Down