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 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
3 changes: 2 additions & 1 deletion impeller/renderer/backend/vulkan/gpu_tracer_vk.cc
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ void GPUTracerVK::MarkFrameStart() {
}

void GPUTracerVK::MarkFrameEnd() {
in_frame_ = false;

if (!enabled_) {
return;
}
Expand All @@ -98,7 +100,6 @@ void GPUTracerVK::MarkFrameEnd() {
FML_DCHECK(state.pending_buffers == 0u);
state.pending_buffers = 0;
state.current_index = 0;
in_frame_ = false;
}

std::unique_ptr<GPUProbe> GPUTracerVK::CreateGPUProbe() {
Expand Down
16 changes: 16 additions & 0 deletions impeller/renderer/backend/vulkan/test/gpu_tracer_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,22 @@ TEST(GPUTracerVK, CanBeDisabled) {
ASSERT_FALSE(tracer->IsEnabled());
}

TEST(GPUTracerVK, DisabledFrameCycle) {
auto const context =
MockVulkanContextBuilder()
.SetSettingsCallback([](ContextVK::Settings& settings) {
settings.enable_gpu_tracing = false;
})
.Build();
auto tracer = context->GetGPUTracer();

// Check that a repeated frame start/end cycle does not fail any assertions.
for (int i = 0; i < 2; i++) {
tracer->MarkFrameStart();
tracer->MarkFrameEnd();
}
}

TEST(GPUTracerVK, CanTraceCmdBuffer) {
auto const context =
MockVulkanContextBuilder()
Expand Down