Skip to content

Build shared libraries with Perfetto tracing in the presets - #94

Merged
ppenenko merged 3 commits into
metashade/devfrom
metashade/presets-shared-perfetto
Nov 11, 2026
Merged

ppenenko merged 3 commits into
metashade/devfrom
metashade/presets-shared-perfetto

Conversation

@ppenenko

@ppenenko ppenenko commented Nov 5, 2026

Copy link
Copy Markdown
Member

Prepares the Windows presets for tracing from Python. A Python extension module is always a DLL, so with static MaterialX libraries each module would link its own copy of MaterialXTrace, and a trace started from Python would miss the events emitted from C++.

  • Turns on MATERIALX_BUILD_SHARED_LIBS and MATERIALX_BUILD_PERFETTO_TRACING.
  • Stops overriding MATERIALX_BUILD_RENDER_SLANG, leaving it at its default (off). MaterialXRenderSlang doesn't compile as a shared library yet.
  • Adds an "Install MaterialX Release" VS Code task.

Signed-off-by: Pavlo Penenko <pavlo.penenko@autodesk.com>
Python can only collect the C++ trace events when all modules share one
MaterialXTrace library.

Signed-off-by: Pavlo Penenko <pavlo.penenko@autodesk.com>
Signed-off-by: Pavlo Penenko <pavlo.penenko@autodesk.com>

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

The preset leaves Slang enabled in existing CMake caches, producing an unsupported shared target, and its default pip installation omits required DLLs, causing imports to fail in fresh Windows Python processes.

2 open issues
What changed in this PR

Prepares the Windows presets for tracing from Python by enabling shared MaterialX libraries, allowing Python extension modules and C++ code to share the tracing implementation.

Changes:

  • Enables shared libraries and Perfetto tracing.
  • Removes the explicit Slang renderer override, relying on its default-off setting.
  • Adds a Release installation task that depends on the Release build.
File Description
CMakePresets.json Enables shared libraries and tracing; removes the Slang renderer override.
.vscode/​tasks.json Adds the “Install MaterialX Release” task.

Review effort: Balanced

Comment thread CMakePresets.json
"MATERIALX_BUILD_PYTHON": "ON",
"MATERIALX_BUILD_TESTS": "ON",
"MATERIALX_BUILD_RENDER_SLANG": "ON"
"MATERIALX_BUILD_SHARED_LIBS": "ON",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Not important because the presets only affect local setups. The build would fail explicitly.

Comment thread CMakePresets.json
"MATERIALX_BUILD_PYTHON": "ON",
"MATERIALX_BUILD_TESTS": "ON",
"MATERIALX_BUILD_RENDER_SLANG": "ON"
"MATERIALX_BUILD_SHARED_LIBS": "ON",

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed by #102

@ppenenko

Copy link
Copy Markdown
Member Author

Logged the Slang shared build issue as #95

@ppenenko
ppenenko merged commit 577130b into metashade/dev Nov 11, 2026
33 of 37 checks passed
@ppenenko
ppenenko deleted the metashade/presets-shared-perfetto branch November 11, 2026 17:40
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