Skip to content

Bring PS5 GTA6 to 120FPS with DLSS 5. An advanced Windows video player and capture enhancement tool featuring real-time preview for videos, images, and capture card sources. Combine AI-powered Super Resolution, DLSS5 image enhancement, and Frame Generation to deliver a next-generation visual experience.

C++

fix(engine): re-render the paused frame when a live parameter changes (colour tables need an ingest pass)

Veyra Goal Agent2c90b129fbf5
diff --git a/apps/veyra/ui/AppShell.cpp b/apps/veyra/ui/AppShell.cpp
index cf634b07..fc891128 100644
--- a/apps/veyra/ui/AppShell.cpp
+++ b/apps/veyra/ui/AppShell.cpp
@@ -67,6 +67,7 @@ bool smokeDual=false,smokeDualPause=false,smokeMaster=false,smokeMasterReject=fa
// open, so a reviewer lands straight on the panel instead of hunting for it.
bool openColourPageOnStart=false;
uint64_t colourLiveRevision=0;
+uint64_t colourPausedBase=0;
void switchMode();void selectInspector(int);
bool applySettings(veyra::engine::EnhancementSettings s){if(masterPendingRevision)return false;uiState.configured=s;if(uiState.enhanced)engine.requestSettings(s);else {auto effective=engine.snapshot().desired;if(effective.captureCompatible!=s.captureCompatible||effective.forceSdrPreview!=s.forceSdrPreview||effective.captureFlipVertical!=s.captureFlipVertical||effective.captureBuffer!=s.captureBuffer||!(effective.color==s.color)){effective.captureCompatible=s.captureCompatible;effective.forceSdrPreview=s.forceSdrPreview;effective.captureFlipVertical=s.captureFlipVertical;effective.captureBuffer=s.captureBuffer;effective.color=s.color;engine.requestSettings(effective);}veyra::log::info("ui-settings","enhancement off: draft saved; presentation setting applied independently");}veyra::ui::settingsEnabled(uiState.enhanced,uiState.configured);return true;}
@@ -777,7 +778,25 @@ else if(colorStep==2){
}else if(colorStep==11){
// Put the value back so the reset/undo expectations below stay meaningful.
if(auto edit=colourControl(1300))SetWindowTextW(edit,L"1.00");
- colorStep=(colourSnapshot.desired.color.exposure==1.0f&&colourSnapshot.applied.color.exposure==1.0f)?3:(elapsed>11000?-1:11);
+ colorStep=(colourSnapshot.desired.color.exposure==1.0f&&colourSnapshot.applied.color.exposure==1.0f)?12:(elapsed>11000?-1:11);
+}
+// Paused adjustments must reach the picture too: pause, edit, and require the
+// engine to re-render the cached frame (counter + log), then resume.
+else if(colorStep==12){
+ colourPausedBase=colourSnapshot.pausedFrameRefreshes;
+ engine.pause(true);
+ if(auto edit=colourControl(1300))SetWindowTextW(edit,L"0.50");
+ colorStep=13;
+}
+else if(colorStep==13){
+ const bool refreshed=colourSnapshot.applied.color.exposure==0.50f&&colourSnapshot.pausedFrameRefreshes>colourPausedBase;
+ colorStep=refreshed?14:(elapsed>13000?-1:13);
+ if(colorStep==14)veyra::log::info("color-ui-test",std::format("paused adjustment re-rendered the frame (refreshes={})",colourSnapshot.pausedFrameRefreshes));
+}
+else if(colorStep==14){
+ engine.pause(false);
+ if(auto edit=colourControl(1300))SetWindowTextW(edit,L"1.00");
+ colorStep=3;
}else if(colorStep==3){SendMessageW(colourControl(801),BM_CLICK,0,0);colorStep=30;}
// The snapshot is taken once per tick, so the reset/undo results are observed on
// the following tick instead of in the same one that clicked the button.
diff --git a/docs/WORKLOG.md b/docs/WORKLOG.md
index 83df1aa2..47a18ab5 100644
--- a/docs/WORKLOG.md
+++ b/docs/WORKLOG.md
@@ -26,6 +26,23 @@
(`logs/delivery/1292ac3a395e451e9d50927f67645df9/result.json`)。
已用修复后的构建重新拉起测试实例(4K GTA VI 片段 + 色彩页)。
+### 追加:暂停时调整也要看得见
+
+用户接着问“为什么暂停时调整看不见、必须播放”。原因:调色**融合在 ingest 的 dispatch 里**,
+而暂停时渲染线程走的是“只把上一帧重新 present”的快路径,**不会再跑 process()**,
+所以新烘焙的表根本没上传到 GPU(`colorDirty_` 一直挂着),只有等下一帧真正处理时才生效。
+
+修复:实时参数更新成功后,如果当前是暂停(或静态图片),置 `refreshPausedFrame_`;
+在暂停快路径里用**缓存下来的源帧**重新过一次 `graph.process(..., reset=true, ...)`,
+再 present 这一帧。代价是每次改动一帧的处理时间(4K 约几毫秒),拖动滑块就是连续重渲染。
+
+新增可测证据:`PlayerSnapshot::pausedFrameRefreshes` 计数器 + 烟测三步
+(暂停→改曝光→要求 `applied` 生效且计数器自增→恢复播放)。日志:
+`[settings] paused frame re-rendered with the new parameters ptsMs=3033.333`、
+`[color-ui-test] paused adjustment re-rendered the frame (refreshes=1)`。
+`--smoke-color` exit 0;`scripts/gates/delivery.ps1` → **DELIVERY SHORT GATE PASS**
+(`logs/delivery/4752929202354ecca7474cdac60f1ccd/result.json`)。
+
## 2026-09-17 色彩页 P1/T3 收口:分组“眼睛”bypass + schema v19
方案 T3 要求的“分组眼睛”落地,并且是**真 bypass**(不只是隐藏 UI):
diff --git a/include/veyra/engine/EngineController.h b/include/veyra/engine/EngineController.h
index 98f3864d..dafc920d 100644
--- a/include/veyra/engine/EngineController.h
+++ b/include/veyra/engine/EngineController.h
@@ -56,6 +56,11 @@ struct PlayerSnapshot {
// window, and measured media-advance / wall-clock playback speed (1.0 =
// normal speed). Zero previewSkipped means every decoded frame was enhanced.
uint64_t previewSkipped=0;
+ // Paused/still-image frames re-rendered because a live parameter changed
+ // (colour is fused into the ingest dispatch, so a paused picture only
+ // updates when the cached source frame is processed again). Test-visible
+ // proof that "adjust while paused" works.
+ uint64_t pausedFrameRefreshes=0;
double playbackSpeed=0;
bool fgBudgetLimited=false,xessGenerationSuppressed=false;
// Runtime-reported DLSSG MultiFrameCountMax: 1 = 2X only, 5 = 6X.
diff --git a/src/engine/EngineController.cpp b/src/engine/EngineController.cpp
index 53b70057..48193570 100644
--- a/src/engine/EngineController.cpp
+++ b/src/engine/EngineController.cpp
@@ -150,8 +150,12 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s
status(L"正在初始化GPU与本地运行时…");
gfx::D3D12DeviceContext ctx;gfx::CommandSlotRing ring;source::MediaFileSource source;
sink::AudioPipeline audioPipe;sink::AudioRenderer audio;VideoPresenter presenter;
- pipeline::EnhanceGraph graph(ctx,ring);AVFrame* imageFrame=nullptr;AVFrame* cachedFrame=nullptr;pipeline::FramePacket cachedPacket;
- source::CaptureCardSource captureSource;const bool physicalCapture=path.starts_with(L"capture:")||path.starts_with(L"capture2:");
+ pipeline::EnhanceGraph graph(ctx,ring);AVFrame* imageFrame=nullptr;AVFrame* cachedFrame=nullptr;pipeline::FramePacket cachedPacket;
+ source::CaptureCardSource captureSource;const bool physicalCapture=path.starts_with(L"capture:")||path.starts_with(L"capture2:");
+ // Set when a live parameter change arrives while paused (or on a still
+ // image): the cached source frame must be re-rendered before the next
+ // present, otherwise the new colour tables never reach the GPU.
+ bool refreshPausedFrame_=false;
#ifdef VEYRA_ENABLE_REMOTEPLAY
auto remote=remoteRequest?std::make_shared<source::RemotePlaySessionSource>():nullptr;
const bool isRemote=bool(remote);
@@ -744,6 +748,11 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s
options=PlayerOptions::from(requested);
{std::lock_guard lock(mutex_);snapshot_.applied=options.snapshot();snapshot_.applying=desired_!=snapshot_.applied;}
veyra::log::info("settings",std::format("live parameter update revision={} colourEnabled={} exposure={:.2f} contrast={:.2f} temperature={:.2f}",requested.revision,requested.color.enabled?1:0,requested.color.exposure,requested.color.contrast,requested.color.temperature));
+ // Colour lives inside the ingest dispatch, so a paused
+ // frame has no process() call to upload the new tables or
+ // re-run the chain: remember that the cached frame must
+ // be re-rendered before the next present.
+ if(paused_||isImage)refreshPausedFrame_=true;
}else{
std::lock_guard lock(mutex_);desired_.rejectVideoRequest(requested,previous);snapshot_.desired=desired_;snapshot_.applying=desired_!=previous;snapshot_.status=L"这套参数需要重建管线,已回到上一套数值";
}
@@ -760,6 +769,25 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s
discardBefore=seek*1000;seekPreviewPending=true;reset=true;pendingResetCause=pipeline::ResetReason::Seek;anchorMs=discardBefore;anchor=Clock::now();lastAudioClockMs=discardBefore;audioClockExhausted=false;audioRebuffering=false;if(audioStarted){audioPipe.setPaused(paused_);audioPipe.requestSeek(discardBefore);}
}
if(!transaction&&((paused_&&!seekPreviewPending)||(isImage&&hasOutput))){
+ // A parameter change while paused (or on a still image) only
+ // reaches the picture if the cached source frame is pushed
+ // through the graph again: the grade is fused into the ingest
+ // dispatch, so nothing else would upload the new tables.
+ if(refreshPausedFrame_){
+ refreshPausedFrame_=false;
+ if(cachedFrame){
+ pipeline::EnhanceGraph::FrameOutputs refreshed;
+ const double refreshPtsMs=cachedPacket.pts.toDouble()*1000.0;
+ if(graph.process(cachedFrame,refreshPtsMs,true,refreshed,cachedPacket.sequence,&cachedPacket.colorInfo,false)){
+ out=refreshed;
+ hasOutput=true;
+ {std::lock_guard lock(mutex_);++snapshot_.pausedFrameRefreshes;}
+ veyra::log::info("settings",std::format("paused frame re-rendered with the new parameters ptsMs={:.3f}",refreshPtsMs));
+ }else{
+ veyra::log::warn("settings","paused frame re-render failed; keeping the previous output");
+ }
+ }
+ }
drainLivePresentation();
if(!wasPaused){holdFileAudio();if(physicalCapture)captureSource.videoReset();
#ifdef VEYRA_ENABLE_REMOTEPLAY