[Depends on #8344] Implement ApiHandler functions and add JsonWriter (#8379)

* Introduce FrameGraphInfo class

* Move the assignment into pimpl

* Make ctors explicit

* Add ctors to fg info structs

* Revert the macro change to align with existing

* Address the comments

* Remove pimpl and move func def to .cc

* Fix

* Convert the FrameGraph to FrameGraphInfo

* Initialize and update debug server on engine side

* Fix compile error

* Address the comments

* Update

* Use camelCase

* Use camelCase

* Update

* Add JsonWriter to convert fginfo to json

* Add getStatus api and implement it

* Add increment

* Implement GET apis

* Fix compile error

* Update

* Use c_str_safe

* Add operator== for FrameGraphInfo

* Call updateFrameGraph in appropriate locations

* Address the comments
This commit is contained in:
Doris Wu
2025-02-15 02:27:42 +00:00
committed by GitHub
parent 05906a5da0
commit 9ca0594d7c
7 changed files with 303 additions and 24 deletions
+12
View File
@@ -110,6 +110,7 @@ ViewHandle DebugServer::createView(utils::CString name) {
std::unique_lock<utils::Mutex> lock(mViewsMutex);
ViewHandle handle = mViewCounter++;
mViews.emplace(handle, FrameGraphInfo(std::move(name)));
mApiHandler->updateFrameGraph(handle);
return handle;
}
@@ -121,8 +122,19 @@ void DebugServer::destroyView(ViewHandle h) {
void DebugServer::update(ViewHandle h, FrameGraphInfo info) {
std::unique_lock<utils::Mutex> lock(mViewsMutex);
const auto it = mViews.find(h);
if (it == mViews.end()) {
slog.w << "[fgviewer] Received update for unknown handle " << h;
return;
}
bool has_changed = !(it->second == info);
if (!has_changed)
return;
mViews.erase(h);
mViews.emplace(h, std::move(info));
mApiHandler->updateFrameGraph(h);
}
} // namespace filament::fgviewer