Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugin load order may result in invalid render engine when loading waves visual plugin #60

Closed
srmainwaring opened this issue Aug 9, 2022 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@srmainwaring
Copy link
Owner

The waves visual plugin is sensitive to the plugin load order when running on an arm64 mac. It is not clear why the issue is not present on an amd64 mac or linux, but the same issue is potentially present.

The problem is that the ogre2 render engine plugin must be loaded and initialised before the waves visual plugin is loaded for the model. The waves visual plugin links directly against the ogre2 render engine plugin library. This library (libgz-rendering7-ogre2.dylib) is installed into two locations (./install/lib and ./install/lib/gz-rendering-7/engine-plugins).

On arm64 macs the libraries are loaded twice, once from each location. The library linked to the visual plugin is loaded first and the render engine is initialised second. This appears to cause dynamic casts of the scene pointer to fail when the scene is being initialised.

Suggested fix

A fix requires better control over the order in which the extensions to the ogre2 render engine that are embedded in the waves visual plugin are loaded.

Currently there is no mechanism in gz-rendering to define custom extensions to the render engine interface and implement these for specific render systems. The waves visual plugin (a system plugin) works around this by defining the extensions directly and hoping that the render engine is available at the point the visual is initialised. This is not robust.

The proposal is add a class for render engine extensions and a manager to load and store them, analogous to the classes for the main render engine. This will allow the loader to check the base render engine plugin is present before loading the extension.

The visual plugin should be written in terms of render engine extension interface classes - rather than depending directly on a specific render engine. This allows the direct linkage to specific render engines to be broken.

@srmainwaring srmainwaring added the bug Something isn't working label Aug 9, 2022
@srmainwaring srmainwaring self-assigned this Aug 9, 2022
@srmainwaring
Copy link
Owner Author

Fixed in #61

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant