Flutter Engine Uber Docs
Docs for the entire Flutter Engine repo.
Loading...
Searching...
No Matches
gpu_submission_tracker.cc
Go to the documentation of this file.
1
// Copyright 2013 The Flutter Authors. All rights reserved.
2
// Use of this source code is governed by a BSD-style license that can be
3
// found in the LICENSE file.
4
5
#include "
impeller/core/gpu_submission_tracker.h
"
6
7
#include <algorithm>
8
9
namespace
impeller
{
10
11
uint64_t
GpuSubmissionTracker::RecordSubmission
() {
12
Lock
lock(mutex_);
13
uint64_t
id
= ++last_id_;
14
pending_.push_back(
id
);
15
return
id
;
16
}
17
18
void
GpuSubmissionTracker::RecordCompletion
(uint64_t
id
) {
19
Lock
lock(mutex_);
20
auto
it = std::lower_bound(pending_.begin(), pending_.end(),
id
);
21
if
(it != pending_.end() && *it ==
id
) {
22
pending_.erase(it);
23
}
24
}
25
26
uint64_t
GpuSubmissionTracker::CompletedThrough
()
const
{
27
Lock
lock(mutex_);
28
if
(pending_.empty()) {
29
return
last_id_;
30
}
31
return
pending_.front() - 1;
32
}
33
34
uint64_t
GpuSubmissionTracker::LatestSubmission
()
const
{
35
Lock
lock(mutex_);
36
return
last_id_;
37
}
38
39
}
// namespace impeller
impeller::GpuSubmissionTracker::LatestSubmission
uint64_t LatestSubmission() const
Returns the id of the most recent submission.
Definition
gpu_submission_tracker.cc:34
impeller::GpuSubmissionTracker::CompletedThrough
uint64_t CompletedThrough() const
Definition
gpu_submission_tracker.cc:26
impeller::GpuSubmissionTracker::RecordCompletion
void RecordCompletion(uint64_t id)
Marks a previously recorded submission as completed by the GPU.
Definition
gpu_submission_tracker.cc:18
impeller::GpuSubmissionTracker::RecordSubmission
uint64_t RecordSubmission()
Records a command buffer submission and returns its id.
Definition
gpu_submission_tracker.cc:11
impeller::Lock
Definition
thread.h:72
gpu_submission_tracker.h
impeller
Definition
texture.h:16
id
const uintptr_t id
Definition
texture_unittests.cc:27
impeller
core
gpu_submission_tracker.cc
Generated on Fri Jul 24 2026 07:12:32 for Flutter Engine Uber Docs by
1.9.8