Skip to content

Conversation

@ryantrem
Copy link
Member

This PR depends on BabylonJS/JsRuntimeHost#125

  • Rework NativeTracing to be build on top of the new PerfTrace helper from JsRuntime's Foundation lib.
  • Add NativeTracing to the iOS app (the platform tracing is currently implemented for).
  • Add a commented out line in experience.js that enables tracing through the Babylon.js API.

@ryantrem ryantrem marked this pull request as draft November 14, 2025 03:24
@ryantrem ryantrem requested review from bghgary and Copilot November 14, 2025 03:25
Copilot finished reviewing on behalf of ryantrem November 14, 2025 03:27
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR reworks the NativeTracing plugin to use the new PerfTrace helper from JsRuntime's Foundation library instead of the direct arcana trace_region implementation. The changes also add NativeTracing initialization to the iOS app and include a commented-out line for enabling tracing via the Babylon.js API.

Key changes:

  • Refactored NativeTracing implementation to use PerfTrace API with handle-based tracing
  • Updated dependencies in CMakeLists files to point to forked repositories with new PerfTrace support
  • Integrated NativeTracing into the iOS app's initialization flow

Reviewed Changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
Plugins/NativeTracing/Source/NativeTracing.cpp Refactored to use Babylon::PerfTrace API instead of arcana::trace_region
Plugins/NativeTracing/CMakeLists.txt Added Foundation library dependency
CMakeLists.txt Updated arcana.cpp and JsRuntimeHost dependency URLs and commit tags to forked versions
Apps/Playground/iOS/LibNativeBridge.mm Added NativeTracing::Initialize call in iOS app initialization
Apps/Playground/Scripts/experience.js Added commented-out line to enable performance tracing through Babylon.js API
Apps/Playground/CMakeLists.txt Added NativeTracing to Playground target link libraries

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@bghgary bghgary left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline.

Update to merged commits
@ryantrem ryantrem marked this pull request as ready for review November 14, 2025 23:57
@ryantrem ryantrem enabled auto-merge (squash) November 14, 2025 23:57
@ryantrem ryantrem merged commit 48b56c6 into BabylonJS:master Nov 15, 2025
19 checks passed
deltakosh pushed a commit to BabylonJS/Babylon.js that referenced this pull request Nov 17, 2025
…ools.EndPerformanceCounter to Babylon Native counterparts (#17450)

NativeTracing has been partially implemented in Babylon Native for a
long time. These changes hook up the Babylon.js perf tracing related
APIs in Tools to the Babylon Native tracing APIs. This extra
functionality will only execute in the context of Babylon Native, and is
resilient to older versions of Babylon Native. For these changes to
fully work, they need
BabylonJS/BabylonNative#1569.

Couple additional changes related to our native interfaces:
- I did a little bit of cleanup on the `INative` interface to make it
more type safe
- ~I added a declation for the `_native` global in
`INativeInterfaces.ts`, which makes it visible globally everywhere so it
doesn't have to be redeclared in every file it is used in. However, I
declared it as potentially undefined (since it is), so I didn't touch a
few files that already declared it as non nullable (like NativeEngine)
as there would be a ton of changes and I didn't want this PR to get too
overloaded.~ Never mind, not in the mood to battle the custom umd type
declaration generation script today.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants