You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Effect keys: register and unregister per assembly (assembly reload, plugin unload)Â #3735
Since #3584, parameter keys are named by source generators (EffectKeysGenerator for hand-written key classes, the shader generator for sdsl/sdfx keys). Both emit a module initializer that calls ParameterKeys.Merge for each key.
ParameterKeys keeps one global table (keyByNames, keys, the composed key cache) that nothing ever clears. Effects work the same way: ShaderMixinManager.Register per effect, and only UnRegisterAll.
So when the editor reloads game assemblies (ReloadAssembliesOperation, and its undo/redo) or a plugin is unloaded, the keys and effect builders of the old assembly stay registered. They stay reachable by name, and they keep the old assembly alive, which blocks unloading a collectible load context.
Proposal, same shape as DataSerializerFactory:
The generators output a list of the assembly's keys (and effect builders) instead of calling Merge.
ParameterKeys and ShaderMixinManager get RegisterAssembly(Assembly) / UnregisterAssembly(Assembly).
Hosts call them where they already call DataSerializerFactory.Register/UnregisterSerializationAssembly (PackageSession, ReloadAssembliesOperation, UnloadAssembliesOperation, LiveAssemblyReloader).
Games keep registering at module init, so user code doesn't change.
Open questions:
Composed and indexed keys made from an unloaded key (ComposeWith, IndexedKey): drop them too?
ParameterCollections that still hold old keys after a reload.
Activity