Skip to content

Remove Metashade override-first library loading from MaterialXTest#16

Merged
ppenenko merged 2 commits into
metashade/devfrom
metashade/revert-extra-library-paths
Jun 27, 2026
Merged

Remove Metashade override-first library loading from MaterialXTest#16
ppenenko merged 2 commits into
metashade/devfrom
metashade/revert-extra-library-paths

Conversation

@ppenenko

Copy link
Copy Markdown
Member

Summary

Reverts the C++ MaterialXTest changes that were made to support Metashade override-first library loading. With PR #12 merged, the override loading is now handled entirely by the Python test infrastructure (test_render_metashade.py).

Provenance

These changes effectively revert the library-path-related portions of the following PRs and commits:

PR / Commit Title What's reverted
PR #5 Schlick BSDF override verification with Metashade wrapper Override-first library loading, source code search path registration, extraLibraryPaths value
041705a8 Relative path to extra libraries extraLibraryPaths value in _options.mtlx
35ef81cc WIP: Override-first library loading for Metashade implementation priority Load order reversal + source path registration in RenderUtil.cpp
34afa787 Revert "Remove registration of source code search paths..." Re-added source path registration in initializeGeneratorContext
PR #9 Move metashade submodule to contrib and update path configurations Updated extraLibraryPaths path (only the path portion is reverted)

Changes

resources/Materials/TestSuite/_options.mtlx

source/MaterialXTest/MaterialXRender/RenderUtil.cpp

loadDependentLibraries — Restore stdlib-first load order:

  • Was: extra libs loaded before stdlib for override priority via document insertion order
  • Now: stdlib loaded first, then extra libs (matching ASWF upstream behavior)

initializeGeneratorContext — Remove extra source code search path registration:

  • Removed: loop registering extraLibraryPaths as source code search paths
  • Removed: registration of libraries/pbrlib/genglsl for wrapper GLSL #include resolution

Why

  1. No longer needed — Python tests handle override loading via explicit mx.readFromXmlFile() with priority ordering
  2. Undesirable — the C++ mechanism caused the Metashade override to load unconditionally in all C++ render tests

Not changed

framesPerMaterial, envSampleCount, GPU timer infrastructure, and enableTracing options are intentionally preserved — these are separate profiling features from PR #1469 (autodesk-forks PRs AcademySoftwareFoundation#2821, AcademySoftwareFoundation#2822, AcademySoftwareFoundation#2824) with open upstream PRs.

ppenenko added 2 commits June 27, 2026 12:42
The Metashade Schlick BSDF override is now loaded by the Python test
infrastructure (test_render_metashade.py) via explicit document loading
with priority ordering. The C++ MaterialXTest extraLibraryPaths mechanism
is no longer needed and was causing the Metashade override to be loaded
unconditionally in all C++ render tests.

Reverts the extraLibraryPaths addition originally introduced in 041705a
and updated in 06790de when the submodule moved to contrib/.
…rUtil.cpp

Restore stdlib-first load order in loadDependentLibraries (revert
35ef81c) and remove extra library / pbrlib genglsl source code search
path registration in initializeGeneratorContext (revert 34afa78).

Both were added for Metashade override-first loading in C++ tests,
which is now handled by the Python test infrastructure.

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.

Pull request overview

This PR reverts prior C++ test-harness changes in MaterialXTest that enforced Metashade “override-first” library loading, returning behavior to the upstream (stdlib-first) load order and removing extra shader source search-path registration. The goal is to ensure Metashade overrides are applied only where explicitly intended (now handled by the Python test infrastructure), rather than affecting all C++ render tests.

Changes:

  • Restore standard-library-first dependency load order in ShaderRenderTester::loadDependentLibraries.
  • Remove registration of extraLibraryPaths and libraries/pbrlib/genglsl as shader source code search paths in initializeGeneratorContext.
  • Clear the default extraLibraryPaths test option back to an empty string in _options.mtlx.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
source/MaterialXTest/MaterialXRender/RenderUtil.cpp Reverts override-first dependent library loading and removes extra source code search path registrations.
resources/Materials/TestSuite/_options.mtlx Resets extraLibraryPaths to empty to match upstream defaults and avoid unconditional Metashade overrides in C++ tests.

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

@ppenenko ppenenko merged commit 64d5838 into metashade/dev Jun 27, 2026
35 of 37 checks passed
@ppenenko ppenenko deleted the metashade/revert-extra-library-paths branch June 27, 2026 20:49
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