Add renderer info query API
Split out from #3254 in response to Haroon's request for smaller Filament PRs.
Summary
- Adds
mjrRendererInfoplusmjr_defaultRendererInfoandmjr_getRendererInfoto report the active renderer family and graphics backend. - Reports classic as
classic/opengl, noop asnoop/none, and Filament asfilamentwith its selected backend. - Adds Python raw alias, pybind struct exposure, render function bindings, introspection metadata, and a binding smoke test.
Validation
git diff --checkpython3 -m py_compile python/mujoco/introspect/functions.py python/mujoco/introspect/structs.py python/mujoco/bindings_test.pyPYTHONPATH=/tmp/mujoco-check-pydeps:python/mujoco python3 python/mujoco/codegen/generate_function_traits.py >/tmp/mujoco-function-traits-check.hPYTHONPATH=/tmp/mujoco-check-pydeps:python/mujoco python3 python/mujoco/codegen/generate_enum_traits.py >/tmp/mujoco-enum-traits-check.hcmake -S . -B /tmp/mujoco-renderer-info-build -DMUJOCO_BUILD_TESTS=ON -DMUJOCO_TEST_PYTHON_UTIL=OFF -DCMAKE_BUILD_TYPE=Releasecmake --build /tmp/mujoco-renderer-info-build --target mujoco -j2
Notes
- Draft PR: full Python wheel/binding build was not completed locally; standalone Python CMake expects setup.py's copied source layout.
backend_versionis reserved and currently returns an empty string until backend-specific version extraction is added.
I guess once this PR is merged, wheels will be built, and the render version will be queryable?
Leaving a note here so I get updated.
Looking forward to this functionality. š
Thanks!
Rebased this onto current main and marked it ready.
Validated with:
git diff --checkpython3 -m py_compile python/mujoco/introspect/functions.py python/mujoco/introspect/structs.py python/mujoco/bindings_test.pyPYTHONPATH=/tmp/mujoco-pr3340-pydeps:python/mujoco python3 python/mujoco/codegen/generate_function_traits.py >/tmp/mujoco-pr3340-function-traits.hPYTHONPATH=/tmp/mujoco-pr3340-pydeps:python/mujoco python3 python/mujoco/codegen/generate_enum_traits.py >/tmp/mujoco-pr3340-enum-traits.hcmake -S . -B /tmp/mujoco-pr3340-build -DMUJOCO_BUILD_TESTS=ON -DMUJOCO_TEST_PYTHON_UTIL=OFF -DCMAKE_BUILD_TYPE=Releasecmake --build /tmp/mujoco-pr3340-build --target mujoco -j2- small
ctypessmoke against the builtlibmujoco.dylib:mjr_getRendererInforeturnsclassic, empty backend, empty backend version before a context exists.
I also tried a narrow Filament/MJR-compat configure. It still hits the separate dear_imgui/SDL2 source-build issue covered by #3252, so Iām not mixing that fix into this API PR.
Rebased this onto current main and fixed the conflict in filament_context.cc. The resolution keeps both sides: upstreams larger Filament command buffers and this PRs stored backend_ for the renderer info API.
Local validation:
git diff --checkpython3 -m py_compile python/mujoco/introspect/functions.py python/mujoco/introspect/structs.py python/mujoco/bindings_test.pyPYTHONPATH=python/mujoco python/mujoco/codegen/generate_function_traits.pyin a fresh venv
@haroonq once fresh CI goes green again, I think this is unblocked for submit. š