Skip to content

Make JsonConvertFactory public sealed#10488

Closed
QuackCola wants to merge 952 commits intoFacepunch:masterfrom
QuackCola:publicsealed-JsonConvertFactory
Closed

Make JsonConvertFactory public sealed#10488
QuackCola wants to merge 952 commits intoFacepunch:masterfrom
QuackCola:publicsealed-JsonConvertFactory

Conversation

@QuackCola
Copy link
Copy Markdown
Contributor

Summary

This pr simply makes the class JsonConvertFactory in Utility/Json/IJsonConvert.cs public sealed

Motivation & Context

This change is needed so JsonConvertFactory can be added to to your own JsonSerializerOptions. So that you can serialize and deserialize types such as Variant when not using Sandbox.Json.Serialize

Implementation Details

Made the class public sealed so that it can be used externally but not extended.

Checklist

  • Code follows existing style and conventions
  • No unnecessary formatting or unrelated changes
  • Public APIs are documented (if applicable)
  • Unit tests added where applicable and all passing
  • I’m okay with this PR being rejected or requested to change 🙂

lolleko and others added 30 commits March 9, 2026 10:17
Collect pending acks in List rather than spamming async tasks.
Process List in Tick.
So we don't allocate when a GameObejct doesn't have any tags
Fast & alloc free pass for GameTags.SetFrom
* Remove unnecessary static singletons in MainMenu code

* Empty SceneWorld delete queues during shutdown

* Dresser cancel async load operation on destroy

* Use reflection to null references to static native resources on shutdown

This way we don't  have to remember doing this manually.

* Fix SoundOcclusionSystem using static lists to reference resources

* Sound System: Use weak references to refer to scenes

* Cleanup static logging listeners that kept strong refs to panels

* UISystem Cleanup, make sure all panel/stylesheet refs are released

* RenderTarget and RenderAttributes shutdown cleanup

* Rework AvatarLoader, ThumbLoader & HTTPImageLoader Cache

First try to go through ResourceLibrary.WeakIndex which might already hold the texture.

If there is no hit, go through a second cache that caches HTTP & Steam API response bytes instead of textures.
We want to cache the response bytes rather than the actual Texture, so stuff cached sits in RAM not VRAM.
Before avatars and thumbs would reside in VRAM.

* Fix rendertarget leak in CommandList.Attr.SetValue

GetDepthTarget() / GetColorTarget() return a new strong handle (ref count +1).
We need to DestroyStrongHandle()  that ref. So handles don't leak.

* Call EngineLoop.DrainFrameEndDisposables before shutdown

* NativeResourceCache now report leaks on shutdown

* Override Resource.Destroy for native resources, kill stronghandles

* Deregister SceneWorld from SceneWorld.All during destruction

* Ensure async texture loading cancels on shutdown

* SkinnedModelRender bonemergetarget deregister from target OnDisabled

* Clear shaderMaterials cache during shutdown

* Refactor Shutdown code

Mostly renaming methods from Clear() -> Shutdown()
Adding separate GlobalContext.Shutdown function (more aggressive than GlobalContext.Reset).
Clear some static input state.

* Deregister surfaces from Surface.All in OnDestroy

* RunAllStaticConstructors when loading a mount

* Advanced managed resource leak tracker enabled via `resource_leak_tracking 1`

Works by never pruning the WeakTable in NativeResourceCache.
So we can check for all resources if they are still being held on to and log a callstack.
* Support types like Curve, Gradient, ParticleGradient in movies
* Fix TransformOperation.OnReduce: old implementation was nonsense, could stack overflow
* Add optional filePath parameter to GenerateScreenshotFilename
* Force movie project to save even if we don't think it's changed
* ITemporaryEffect.IsActive pseudo-property for movie recordings
* Add ITrack.GetPathString() extension
* Safety when trying to compress a sample block
* Skip updating playback rate on renderers with a bone merge target
* Move PropertySignal<T>.FromSamples to PropertySignal
* Fix view not always updating when zooming
* Enabled tracks defaults to false when applying
* Movie export: manually call Scene.EditorTick, pause updates elsewhere (fixes Facepunch#10137)
* CanMakeTrackFromProperties: default to only allowing user types
Introduced in Facepunch/sbox#4242 , which added some additional panel cleanup
Ignore static members when serializing or cloning components, makes no sense and breaks cloning with Expression Trees (that was introduced in Facepunch/sbox#4202)

Fixes Facepunch#10161
Synthesizer never disposed its SpeechSynthesizer, causing background VoiceSynthesis threads to accumulate indefinitely (30+ seen in crash dumps).
This may have caused crashes in TTS heavy games like DXRP.

In addition we now properly terminate the SoundStream so SoundHandle.IsPlaying will become false after the stream has been played.

See: Facepunch#4184
Needs to be rethought, it gets in the way often -- keeping view handle though
* Sync localisation files to clients thru network files
* Changing lang triggers Panel.LanguageChanged again, so we can rebuild panels, labels, etc.
* Init ActiveFriends as Enumerable.Empty

* Snip IconPanel logging its url
…punch#4283)

Benchmark runner loads scenes in succession.
If a previous scene already generated a navmesh, on the load of another scene the navmesh bounds would not update, because the bounds where already set by the previous scene.
Fixed by always updating the bounds if CustomBounds is not set.
* Kill CrashReporter before unloading steam DLL

* Properly shutdown SteamAPI on SourceEngine exit

* Smaller minidumps for retail builds

We can use a minimal minidump and still extract managed stack traces
lolleko and others added 27 commits April 9, 2026 10:31
Managed will queue deletion no need to check for proper destruction this early
…acepunch#4525)

* WildcardMatch use MatchesSimpleExpression instead of expensive regex

* More WildcardMatch tests
Dot-based AlmostEqual returned false for zero quaternions (default==default would be false), breaking the transform guard that catches uninitialized transforms.
* Don't UpdatePrefabInstances if the edited PrefabScene is the only one open in editor

* Avoid some allocations when processing prefab guid mappings

* Json Diff use 64bit hash isntead of paths for presence tracking, which avoids a ton of string allocations

* Less LINQ in prefab GUID tracking code
* Add Texture Pool section to shadow debug

https://files.facepunch.com/lolleko/2026/April/13_16-21-UsedRook.png

Shows of orphaned textures (in flight stat keeps growing.

* Return shadow map to pool when light is destroyed

https://files.facepunch.com/lolleko/2026/April/13_16-24-ClutteredCooter.png

* Use Queue instead of Stack for shadow texture pool eviction

We want FIFO semantics instead of LIFO.
Stack (LIFO) buried old textures under newer ones, potentially preventing disposal

* Remove unused OnLightRemoved callback
* Reduce allocation pressure in shadow mapper hot path.

Gets rid of a Bunch of array, IEnumerable and LINQ allocations.
It's only tiny bit more verbose

* Avoid string allocation every frame

* FindOrCreateProjectedCubeShadowMap: avoid allocations & frustum/matrix math

* AddShadowView: avoid CFmtStr in hot path
- Fix hotloading breaking ScenePanels
- `ScenePanel.Scene` setter now handles cleanup and will make sure re-assigning the same scene instance doessn't break anything
- Add tests
- `movie` command records light components
- Only include shadow properties if shadows are enabled
- Record DirectionalLight.SkyColor so things like day/night cycles are included in recordings properly

https://files.facepunch.com/CarsonKompon/2026/April/13_11-16-RoastedRook.mp4
* Hotspot tweaks

-Use Active Material
-Allow Mirror Horizontal/ Vertical
-Button for apply per face.

https://files.facepunch.com/louie/1b1411b1/sbox-dev_M3ykoez2o2.png
* Make Editable Mesh inside undo scope

* Copilot suggestion

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* Stupid robot just getcomponent

---------

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
New UI rendering that groups multiple panels to be grouped into a single draw call when possible.

New custom rendering API for custom panels using `Panel.Draw.XX` to emit drawing commands.
* Remove duplicated linux libraries and renamed them correctly, managed native libraries should have no versioning, libswscale was still being symlinked

* Fix case sensitiveness on these, causes Code folder to be doubled and make case insensitive vfs confused, no idea how this even happened

* Fix case sensitivity in asset paths to ensure sanity
* Use Hilbert Index instead of Blue Noise for GTAO, same as the original paper, allows us to have better quality with less work, GTAOPasses::DenoiseSpatial does two pixels for one thread

* Force Float16 for GTAO, good speedups on modern GPUs, default behaviour from reference implementation, do explicit casts to supress warnings

* More accurate MSAAUtils::GetSampleIndex  https://files.facepunch.com/sampavlovic/1b2611b1/image.psd.png

* adjustments

* reduce blending for non-edge pixels to preserve more details instead of using the raw amount at edges

* Early out here, no good way to have a non uniform size dispatch yet, should still keep 2x spatial speedup

* Remove unused comment

* update shaders
@sboxbot sboxbot closed this Apr 16, 2026
@QuackCola QuackCola deleted the publicsealed-JsonConvertFactory branch April 16, 2026 13:46
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.