Clean up shape
All checks were successful
CI / React UI Build (push) Successful in 10s
CI / Native Windows Build And Tests (push) Successful in 2m41s
CI / Windows Release Package (push) Successful in 2m48s

This commit is contained in:
Aiden
2026-05-11 19:37:44 +10:00
parent a530325fa1
commit a91cc91a21
5 changed files with 22 additions and 54 deletions

View File

@@ -4,6 +4,7 @@
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <sstream>
RenderEngine::RenderEngine( RenderEngine::RenderEngine(
RuntimeSnapshotProvider& runtimeSnapshotProvider, RuntimeSnapshotProvider& runtimeSnapshotProvider,

View File

@@ -22,7 +22,6 @@
#include <memory> #include <memory>
#include <mutex> #include <mutex>
#include <queue> #include <queue>
#include <sstream>
#include <string> #include <string>
#include <thread> #include <thread>
#include <utility> #include <utility>

View File

@@ -2,23 +2,13 @@
#define __OPENGL_COMPOSITE_H__ #define __OPENGL_COMPOSITE_H__
#include <windows.h> #include <windows.h>
#include <process.h>
#include <tchar.h>
#include <gl/gl.h>
#include <gl/glu.h>
#include <objbase.h> #include <objbase.h>
#include <atlbase.h>
#include <comutil.h>
#include "GLExtensions.h"
#include "RenderFrameState.h" #include "RenderFrameState.h"
#include <functional>
#include <filesystem> #include <filesystem>
#include <memory> #include <memory>
#include <string> #include <string>
#include <vector>
class RenderEngine; class RenderEngine;
class RuntimeCoordinator; class RuntimeCoordinator;

View File

@@ -261,7 +261,7 @@ Initial target:
Possible outcomes: Possible outcomes:
- [x] add a new `LayeredRenderStateInput` - [x] add a new `LayeredRenderStateInput`
- [ ] add a thin adapter if a later migration needs compatibility with the previous input shape - [x] no adapter was needed; callers now use the layered input shape directly
### Step 3. Make Reset And Reload Policy Explicit ### Step 3. Make Reset And Reload Policy Explicit

View File

@@ -23,7 +23,7 @@ Before the Phase 1 runtime split, the closest behavior lived in:
- `RuntimeHost::BuildLayerRenderStatesLocked(...)` - `RuntimeHost::BuildLayerRenderStatesLocked(...)`
- the render-side cache usage in [OpenGLComposite.cpp](/c:/Users/Aiden/Documents/GitHub/video-shader-toys/apps/LoopThroughWithOpenGLCompositing/gl/composite/OpenGLComposite.cpp:589) - the render-side cache usage in [OpenGLComposite.cpp](/c:/Users/Aiden/Documents/GitHub/video-shader-toys/apps/LoopThroughWithOpenGLCompositing/gl/composite/OpenGLComposite.cpp:589)
`RuntimeSnapshotProvider` should absorb that responsibility, but in a cleaner and more publish-oriented way. `RuntimeSnapshotProvider` has absorbed that responsibility in a cleaner and more publish-oriented way.
## Responsibilities ## Responsibilities
@@ -220,9 +220,9 @@ The target read contract for `RenderEngine` should be:
Important rule: Important rule:
- `RenderEngine` should never partially mutate the providers published snapshot in place - `RenderEngine` should never partially mutate the provider's published snapshot in place.
That means todays `TryRefreshCachedLayerStates(...)` behavior is a migration waypoint, not a target pattern. Once the provider exists, the render side should treat the snapshot as immutable input and keep any overlays or last-frame adjusted values inside `RenderEngine`. The old `TryRefreshCachedLayerStates(...)` host path is gone. The remaining dynamic refresh is explicit: `RuntimeSnapshotProvider::RefreshDynamicRenderStateFields(...)` updates frame-local fields on render-owned copies, while published snapshot structure and committed parameter data stay behind the provider boundary.
## Render-Facing Data Shape Rules ## Render-Facing Data Shape Rules
@@ -338,42 +338,7 @@ This is especially important while migrating away from the current lock/fallback
## Current Code Mapping ## Current Code Mapping
The current code follows this migration map. The current runtime path is:
### Move into `RenderSnapshotBuilder`
From `RuntimeHost`:
- layer render-state construction from `BuildLayerRenderStatesLocked(...)`
- render-facing translation of layer persistent state plus package metadata
- explicit version composition for render-visible state
- dynamic frame-context construction currently done in `RefreshDynamicRenderStateFields(...)`
### Move into `RuntimeSnapshotProvider`
- published snapshot cache ownership
- version matching for already-published snapshots
- render-facing compatibility API while render callers migrate
### Stop exposing directly from the host/store boundary
Current methods that should become compatibility shims and later disappear:
- `GetLayerRenderStates(...)`
- `TryGetLayerRenderStates(...)`
- `TryRefreshCachedLayerStates(...)`
- `RefreshDynamicRenderStateFields(...)`
### Render-side compatibility during migration
The previous `OpenGLComposite` cache path:
- read versions from `RuntimeHost`/store-owned counters
- conditionally calls `TryRefreshCachedLayerStates(...)`
- conditionally rebuilds full layer state
- then reapplies render-local OSC overlay state
The migrated runtime path is:
1. get latest published snapshot from provider 1. get latest published snapshot from provider
2. compare snapshot versions produced by `RenderSnapshotBuilder` 2. compare snapshot versions produced by `RenderSnapshotBuilder`
@@ -381,7 +346,20 @@ The migrated runtime path is:
4. apply render-local overlay state 4. apply render-local overlay state
5. attach frame context 5. attach frame context
That is a much cleaner split than the current mixed lock/cache/fallback flow in [OpenGLComposite.cpp](/c:/Users/Aiden/Documents/GitHub/video-shader-toys/apps/LoopThroughWithOpenGLCompositing/gl/composite/OpenGLComposite.cpp:589). That replaced the old mixed lock/cache/fallback flow that lived around [OpenGLComposite.cpp](/c:/Users/Aiden/Documents/GitHub/video-shader-toys/apps/LoopThroughWithOpenGLCompositing/gl/composite/OpenGLComposite.cpp:589).
`RenderSnapshotBuilder` now owns:
- layer render-state construction
- render-facing translation of committed live state plus package metadata
- explicit version composition for render-visible state
- dynamic frame-field refresh for render-owned copies
`RuntimeSnapshotProvider` now owns:
- published snapshot cache ownership
- version matching for already-published snapshots
- publication events and snapshot publish observations
## Migration Plan ## Migration Plan
@@ -403,8 +381,8 @@ That is a much cleaner split than the current mixed lock/cache/fallback flow in
### Step 4: Remove mutable snapshot refresh paths ### Step 4: Remove mutable snapshot refresh paths
- retire `TryRefreshCachedLayerStates(...)` - completed: retire the old `TryRefreshCachedLayerStates(...)` host path
- publish new snapshots for committed parameter changes instead of mutating render-cached host-derived vectors in place - publish new snapshots for committed parameter changes instead of mutating published snapshot structure in place
### Step 5: Move publication triggering fully behind `RuntimeCoordinator` ### Step 5: Move publication triggering fully behind `RuntimeCoordinator`