Skip to content

Commit f90de26

Browse files
authored
fix disable_gpu_frame_complete_metric flag (#9473)
- set the flag to true (metrics disabled) until downstream is ready - make sure to exit the JobQueue thread before destroying it BUGS=[464370498]
1 parent cc2e661 commit f90de26

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

filament/src/details/Engine.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -781,7 +781,7 @@ class FEngine : public Engine {
781781
bool assert_camera_projection_near_far = CORRECTNESS_ASSERTION_DEFAULT;
782782
} debug;
783783
struct {
784-
bool disable_gpu_frame_complete_metric = false;
784+
bool disable_gpu_frame_complete_metric = true;
785785
} frame_info;
786786
} engine;
787787
struct {

libs/utils/src/AsyncJobQueue.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ AsyncJobQueue::AsyncJobQueue(const char* name, Priority priority) {
5555
}
5656

5757
AsyncJobQueue::~AsyncJobQueue() noexcept {
58+
// wait for all pending callbacks to be called & terminate the thread
59+
drainAndExit();
5860
#if !defined(__EMSCRIPTEN__)
61+
assert_invariant(!mThread.joinable());
5962
assert_invariant(mQueue.empty());
6063
#endif
6164
}
@@ -94,6 +97,9 @@ bool AsyncJobQueue::isValid() const noexcept {
9497
void AsyncJobQueue::drainAndExit() {
9598
#if !defined(__EMSCRIPTEN__)
9699
std::unique_lock lock(mLock);
100+
if (mExitRequested) {
101+
return;
102+
}
97103
// we request the service thread to exit, but we're guaranteed that it'll only exit
98104
// after all current callbacks are processed. In addition, once mExitRequested is set,
99105
// no new jobs can be added, so we can join the thread.

0 commit comments

Comments
 (0)