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++

fg-gpu-home: DLSS 性能模式, compute GPU choice, fullscreen Home panel from 极简/节点

Veyra Goal Agentedce7d18f31a
diff --git a/i18n/catalog.json b/i18n/catalog.json
index 40fadb5e..fcce0ba9 100644
--- a/i18n/catalog.json
+++ b/i18n/catalog.json
@@ -6567,13 +6567,6 @@
"en": "Could not save the shortcut",
"ja": "ショートカットを保存できませんでした"
},
- {
- "zh": "快速调节只在专业模式的列表视图可用",
- "src": "qml/Main.qml",
- "zh-TW": "快速調節只在專業模式的列表視圖可用",
- "en": "Quick settings are available only in Pro mode's list view",
- "ja": "クイック設定はプロモードのリスト表示でのみ使えます"
- },
{
"zh": "性能",
"src": "qml/NodePage.qml",
@@ -15947,6 +15940,90 @@
"zh-TW": "可變更新:超過螢幕最高更新時只排 1 幀",
"en": "Variable refresh: at most 1 frame queued above the maximum refresh",
"ja": "可変リフレッシュ:最大リフレッシュを超える時だけ 1 フレーム待機"
+ },
+ {
+ "zh": "DLSS 性能模式",
+ "src": "qml/ProPage.qml",
+ "zh-TW": "DLSS 效能模式",
+ "en": "DLSS performance mode",
+ "ja": "DLSS パフォーマンスモード"
+ },
+ {
+ "zh": "引擎未接受 DLSS 性能模式,原设置保留",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "引擎未接受 DLSS 效能模式,原設定保留",
+ "en": "The engine did not accept the DLSS performance mode; the previous setting is kept",
+ "ja": "エンジンが DLSS パフォーマンスモードを受け付けませんでした。元の設定を維持します"
+ },
+ {
+ "zh": "此软件包没有附带性能模式所需的 DLSS 帧生成 310.9.16 运行库",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "此軟體包沒有附帶效能模式所需的 DLSS 幀生成 310.9.16 執行庫",
+ "en": "This package does not include the DLSS Frame Generation 310.9.16 runtime the performance mode needs",
+ "ja": "このパッケージにはパフォーマンスモードに必要な DLSS フレーム生成 310.9.16 ランタイムが含まれていません"
+ },
+ {
+ "zh": "目前只支持 RTX 50 系列:40/30 系的多帧解锁只适用于原版运行库",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "目前只支援 RTX 50 系列:40/30 系的多幀解鎖只適用於原版執行庫",
+ "en": "RTX 50 series only for now: the RTX 40/30 multi-frame unlock works with the standard runtime only",
+ "ja": "現在は RTX 50 シリーズのみ対応:RTX 40/30 のマルチフレーム解除は標準ランタイムでのみ動作します"
+ },
+ {
+ "zh": "生效中:NVIDIA DLSS 帧生成性能模式(测试版)",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "生效中:NVIDIA DLSS 幀生成效能模式(測試版)",
+ "en": "Active: NVIDIA DLSS Frame Generation performance mode (beta)",
+ "ja": "動作中:NVIDIA DLSS フレーム生成パフォーマンスモード(ベータ)"
+ },
+ {
+ "zh": "NVIDIA 新增的性能模式(测试版):补帧更省 GPU,高倍率更稳,画质可能略降;导出仍用标准模式",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "NVIDIA 新增的效能模式(測試版):補幀更省 GPU,高倍率更穩,畫質可能略降;匯出仍用標準模式",
+ "en": "NVIDIA's new performance mode (beta): frame generation uses less GPU and holds high multipliers better, possibly at slightly lower quality; export keeps the standard mode",
+ "ja": "NVIDIA の新しいパフォーマンスモード(ベータ):フレーム生成の GPU 負荷が減り高倍率でも安定、画質はやや落ちる場合あり。書き出しは標準モードのまま"
+ },
+ {
+ "zh": "同时用这块显卡运算",
+ "src": "qml/SettingsPage.qml",
+ "zh-TW": "同時用這塊顯示卡運算",
+ "en": "Also compute on this GPU",
+ "ja": "このGPUで処理も行う"
+ },
+ {
+ "zh": "关闭时增强、补帧和导出用性能最强的显卡",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "關閉時增強、補幀和匯出用效能最強的顯示卡",
+ "en": "When off, enhancement, frame generation and export use the most powerful GPU",
+ "ja": "オフのときは補正・フレーム生成・書き出しに最も高性能な GPU を使います"
+ },
+ {
+ "zh": "增强、补帧和导出都在「%1」上运行;切换后重新打开视频生效",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "增強、補幀和匯出都在「%1」上執行;切換後重新開啟影片生效",
+ "en": "Enhancement, frame generation and export run on \"%1\"; reopen the video after switching",
+ "ja": "補正・フレーム生成・書き出しは「%1」で実行します。切り替え後は動画を開き直してください"
+ },
+ {
+ "zh": "上面选“自动”时仍用性能最强的显卡;选一块显卡后它也负责运算",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "上面選「自動」時仍用效能最強的顯示卡;選一塊顯示卡後它也負責運算",
+ "en": "With \"Auto\" above, the most powerful GPU is still used; pick a GPU above to compute on it too",
+ "ja": "上で「自動」の場合は最も高性能な GPU を使用。GPU を選ぶとその GPU で処理も行います"
+ },
+ {
+ "zh": "运算显卡已切换为「%1」,重新打开视频后生效",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "運算顯示卡已切換為「%1」,重新開啟影片後生效",
+ "en": "Compute GPU switched to \"%1\"; it applies after reopening the video",
+ "ja": "処理用 GPU を「%1」に切り替えました。動画を開き直すと反映されます"
+ },
+ {
+ "zh": "运算显卡已恢复默认(性能最强的显卡),重新打开视频后生效",
+ "src": "src/ui/QmlPlayerBridge.cpp",
+ "zh-TW": "運算顯示卡已恢復預設(效能最強的顯示卡),重新開啟影片後生效",
+ "en": "Compute GPU back to the default (the most powerful GPU); it applies after reopening the video",
+ "ja": "処理用 GPU を既定(最も高性能な GPU)に戻しました。動画を開き直すと反映されます"
}
]
}
diff --git a/include/veyra/engine/EngineController.h b/include/veyra/engine/EngineController.h
index a89597ed..23c51d48 100644
--- a/include/veyra/engine/EngineController.h
+++ b/include/veyra/engine/EngineController.h
@@ -135,6 +135,9 @@ struct PlayerSnapshot {
// multipliers the active GPU can actually honour.
int fgMultiFrameMax=0;
bool fgCapabilityKnown=false;
+ // DLSS-G performance mode of the active graph (EnhanceGraph::dlssgLiteState):
+ // 0 not requested, 1 active, 2 runtime missing, 3 GPU keeps the default runtime.
+ uint32_t dlssgLiteState=0;
// XeSS frame-generation ceiling (generated frames; 1 = stock 2X, 3 = 4X).
// 0 = no XeSS session has reported yet; the settings UI then falls back to
// the audited-provider probe.
diff --git a/include/veyra/engine/EnhancementSettings.h b/include/veyra/engine/EnhancementSettings.h
index 0d72ab72..ec411a5f 100644
--- a/include/veyra/engine/EnhancementSettings.h
+++ b/include/veyra/engine/EnhancementSettings.h
@@ -350,6 +350,9 @@ struct EnhancementSettings {
// UI "边缘神盾": refined optical-flow motion for XeSS frame generation (edge refinement
// and the uncovered-background fill). A global control kept in shell preferences.
bool fgMotionRefine=true;
+ // UI "DLSS 性能模式": NVIDIA's DLSS-G performance mode (ngx/DlssgLite.h),
+ // DLSS frame generation only. A global control kept in shell preferences.
+ bool dlssgLite=false;
ContentRate content=ContentRate::Transport;
AudioSyncMode audioSync=AudioSyncMode::Automatic;
int32_t audioOffsetMs=0;
@@ -404,6 +407,7 @@ struct EnhancementSettings {
// Only XeSS frame generation with optical-flow motion reads the refined vectors.
if(!(multiplier>1&&frameGenerationBackend==FrameGenerationBackend::XeSS&&motionUsesFlow(fgMotion,frameGenerationBackend)))
active.fgMotionRefine=defaults.fgMotionRefine;
+ if(!(multiplier>1&&frameGenerationBackend==FrameGenerationBackend::Dlss))active.dlssgLite=defaults.dlssgLite;
return active;
}
bool sameActiveVideoParameters(const EnhancementSettings& other) const {
diff --git a/include/veyra/engine/GraphDescription.h b/include/veyra/engine/GraphDescription.h
index f7a07f11..6f17564f 100644
--- a/include/veyra/engine/GraphDescription.h
+++ b/include/veyra/engine/GraphDescription.h
@@ -125,7 +125,7 @@ inline pipeline::ResolutionPlan describeStages(const StageRequest& request,const
desc.flowQuality=settings.flow;
desc.contentRate=settings.content;
desc.opticalFlowBackend=settings.opticalFlowBackend;
- desc.amdFlowHalfResolution=settings.amdFlowHalfResolution;desc.fgMotionRefine=settings.fgMotionRefine;
+ desc.amdFlowHalfResolution=settings.amdFlowHalfResolution;desc.fgMotionRefine=settings.fgMotionRefine;desc.dlssgLite=settings.dlssgLite;
desc.nrLayersExtent.clear();
for(uint32_t i=0;i<chain.nodeCount;++i){
auto& node=chain.nodes[i];
diff --git a/include/veyra/gfx/D3D12DeviceContext.h b/include/veyra/gfx/D3D12DeviceContext.h
index aebfdff9..8d0d4031 100644
--- a/include/veyra/gfx/D3D12DeviceContext.h
+++ b/include/veyra/gfx/D3D12DeviceContext.h
@@ -29,6 +29,14 @@ struct AdapterInfo {
std::wstring driverVersionSource; // "registry" or "dxgi-raw"
};
+// Compute adapter chosen in 设置 -> "同时用这块显卡运算" (0 = default order,
+// highest-performance hardware adapter first). A device created without
+// requiredLuid tries it first and falls back to the default order. Kept in
+// the process environment (VEYRA_COMPUTE_ADAPTER_LUID) so export worker
+// processes, which create their own device, inherit it.
+void setPreferredAdapterLuid(uint64_t luid);
+uint64_t preferredAdapterLuid();
+
struct DeviceContextDesc {
bool enableDebugLayer = false;
uint32_t commandSlotCount = 4;
diff --git a/include/veyra/ngx/DlssFgBackend.h b/include/veyra/ngx/DlssFgBackend.h
index e2658bd2..6b9f9ce8 100644
--- a/include/veyra/ngx/DlssFgBackend.h
+++ b/include/veyra/ngx/DlssFgBackend.h
@@ -58,6 +58,7 @@ public:
uint32_t renderHeight;
uint32_t backbufferFormat; // DXGI_FORMAT of backbuffer (e.g. R8G8B8A8_UNORM)
bool dynamicResolution;
+ bool lite = false; // DLSS-G performance mode (ngx/DlssgLite.h), create-time only
};
struct EvalDesc {
diff --git a/include/veyra/ngx/DlssgLite.h b/include/veyra/ngx/DlssgLite.h
new file mode 100644
index 00000000..ef9bf93d
--- /dev/null
+++ b/include/veyra/ngx/DlssgLite.h
@@ -0,0 +1,31 @@
+#pragma once
+// DLSS Frame Generation performance mode (NVIDIA App 11.0.9 "Model C", beta).
+//
+// NVIDIA delivers it as DLSS-G 310.9.16 (driver OTA download, nvapp_override
+// build). That runtime adds "FG Lite" candidate blending behind the
+// create-time parameter DLSSG.LiteCandidateBlendingEnabled; the 310.9.1 copy
+// Veyra keeps as its default ignores the parameter. Measured 2026-10-14 on an
+// RTX 5070 (2K60 NV12 + NR): DLSS-G GPU time P95 4X 5.6 -> 2.8 ms, 6X 8.0 ->
+// 3.3 ms; setting it per evaluate has no effect, only at create.
+//
+// The runtime ships beside the default one in runtime/experimental/dlssg-lite
+// (user decision 2026-10-14) and is used only while the mode is on: NGX then
+// searches that directory before the default runtime directory. RTX 40/30
+// keep 310.9.1, whose audited multi-frame patches do not apply to 310.9.16.
+#include <filesystem>
+#include <system_error>
+
+namespace veyra::ngx {
+
+inline constexpr const char* kDlssgLiteParameter = "DLSSG.LiteCandidateBlendingEnabled";
+
+inline std::filesystem::path dlssgLiteDirectory(const std::filesystem::path& runtimeDirectory) {
+ return runtimeDirectory / L"dlssg-lite";
+}
+
+inline bool dlssgLiteRuntimePresent(const std::filesystem::path& runtimeDirectory) {
+ std::error_code ec;
+ return std::filesystem::is_regular_file(dlssgLiteDirectory(runtimeDirectory) / L"nvngx_dlssg.dll", ec);
+}
+
+} // namespace veyra::ngx
diff --git a/include/veyra/ngx/NgxCoreCache.h b/include/veyra/ngx/NgxCoreCache.h
index ab9be1c7..2b05c93b 100644
--- a/include/veyra/ngx/NgxCoreCache.h
+++ b/include/veyra/ngx/NgxCoreCache.h
@@ -18,6 +18,7 @@ public:
bool frameGeneration = false;
int fgBackend = 0;
unsigned fgMultiplier = 1;
+ std::wstring dlssgDirectory; // DLSS-G performance-mode runtime, searched first
bool operator==(const Key&) const = default;
};
~NgxCoreCache();
diff --git a/include/veyra/ngx/NgxCoreHost.h b/include/veyra/ngx/NgxCoreHost.h
index a93cb18d..dcff44eb 100644
--- a/include/veyra/ngx/NgxCoreHost.h
+++ b/include/veyra/ngx/NgxCoreHost.h
@@ -25,11 +25,14 @@ public:
// `runtimeDir` is the absolute staged runtime directory used both as the
// feature search path (PathListInfo) and application data path. The
// project identity strings come from runtime_local/config/ngx-local.json.
+ // priorityDirectory, when set, is searched before runtimeDir for every
+ // feature DLL (the DLSS-G performance-mode runtime, ngx/DlssgLite.h).
bool initialize(ID3D12Device* device,
const std::wstring& runtimeDir,
const char* projectId,
const char* engineVersion,
- Status& status);
+ Status& status,
+ const std::wstring& priorityDirectory = {});
void shutdown();
bool initialized() const { return initialized_; }
diff --git a/include/veyra/pipeline/EnhanceGraph.h b/include/veyra/pipeline/EnhanceGraph.h
index 8cd0e00f..b561e75b 100644
--- a/include/veyra/pipeline/EnhanceGraph.h
+++ b/include/veyra/pipeline/EnhanceGraph.h
@@ -134,6 +134,8 @@ struct EnhanceGraphDesc {
// XeSS motion refinement with the optical-flow source (UI "边缘神盾"): FlowRefine/
// FlowFill plus NVOF forward-backward or FidelityFX FlowClaim. Off: validated flow.
bool fgMotionRefine=true;
+ // DLSS-G performance mode (ngx/DlssgLite.h): DLSS frame generation only.
+ bool dlssgLite=false;
engine::ContentRate contentRate=engine::ContentRate::Transport;
engine::NrSettings model;
engine::ResidualSettings residual;
@@ -624,6 +626,10 @@ public:
uint64_t nrCreateResult() const { return nrResult_; }
uint64_t failedNgxResult() const;
const std::wstring& driverRequirementNotice() const {return driverRequirementNotice_;}
+ // DLSS-G performance mode: 0 not requested (or not DLSS FG), 1 active,
+ // 2 its runtime is missing, 3 this GPU keeps the default runtime (RTX
+ // 40/30 multi-frame patches are audited for 310.9.1 only).
+ uint32_t dlssgLiteState() const {return dlssgLiteState_;}
bool fgCapabilityAvailable() const { return fgCapsAvailable_; }
int fgMultiFrameCountMax() const { return fgMultiFrameMax_; }
// Scenario toggles (probe/UI): gates only; the feature handles stay alive.
@@ -830,6 +836,8 @@ private:
uint64_t nrResult_ = 0;
uint64_t fgInitResult_ = 0;
std::wstring driverRequirementNotice_;
+ uint32_t dlssgLiteState_ = 0;
+ std::wstring dlssgDirectory_;
uint32_t nrSeh_ = 0;
bool fgCapsAvailable_ = false;
int fgMultiFrameMax_ = 0;
diff --git a/include/veyra/ui/QmlPlayerBridge.h b/include/veyra/ui/QmlPlayerBridge.h
index 1bfe2253..382270d9 100644
--- a/include/veyra/ui/QmlPlayerBridge.h
+++ b/include/veyra/ui/QmlPlayerBridge.h
@@ -213,6 +213,9 @@ class QmlPlayerBridge : public QObject {
// 2026-10-02: the orb used to add the integrated and the discrete GPU together.
Q_PROPERTY(QVariantList gpuMonitorChoices READ gpuMonitorChoices CONSTANT)
Q_PROPERTY(QString gpuMonitorName READ gpuMonitorName NOTIFY preferencesChanged)
+ // 设置 -> "同时用这块显卡运算" (preference computeOnMonitorGpu): the GPU picked
+ // for monitoring also runs enhancement, frame generation and export.
+ Q_PROPERTY(QString computeGpuHint READ computeGpuHint NOTIFY preferencesChanged)
Q_PROPERTY(QString audioOutputStatus READ audioOutputStatus NOTIFY audioDevicesChanged)
Q_PROPERTY(bool audioOutputFallback READ audioOutputFallback NOTIFY audioDevicesChanged)
Q_PROPERTY(QString logFile READ logFile CONSTANT)
@@ -335,6 +338,11 @@ class QmlPlayerBridge : public QObject {
Q_PROPERTY(bool amdFlowHalf READ amdFlowHalf WRITE setAmdFlowHalf NOTIFY settingsChanged)
// 边缘神盾: refined optical-flow motion for XeSS (EnhancementSettings::fgMotionRefine).
Q_PROPERTY(bool edgeAegis READ edgeAegis WRITE setEdgeAegis NOTIFY settingsChanged)
+ // DLSS 性能模式: NVIDIA's DLSS-G performance mode (EnhancementSettings::dlssgLite);
+ // available when the package carries its runtime (runtime/experimental/dlssg-lite).
+ Q_PROPERTY(bool dlssgLite READ dlssgLite WRITE setDlssgLite NOTIFY settingsChanged)
+ Q_PROPERTY(bool dlssgLiteAvailable READ dlssgLiteAvailable CONSTANT)
+ Q_PROPERTY(QString dlssgLiteHint READ dlssgLiteHint NOTIFY snapshotChanged)
Q_PROPERTY(int contentRate READ contentRate WRITE setContentRate NOTIFY settingsChanged)
Q_PROPERTY(int hdrOutputMode READ hdrOutputMode WRITE setHdrOutputMode NOTIFY settingsChanged)
Q_PROPERTY(int fgMotionSource READ fgMotionSource WRITE setFgMotionSource NOTIFY settingsChanged)
@@ -707,6 +715,7 @@ public:
Q_INVOKABLE void openReleasesPage();
QVariantList audioDevices() const;
QVariantList gpuMonitorChoices() const;
+ QString computeGpuHint() const;
QString gpuMonitorName() const;
QString audioOutputStatus() const;
bool audioOutputFallback() const;
@@ -868,6 +877,10 @@ public:
void setAmdFlowHalf(bool value);
bool edgeAegis() const;
void setEdgeAegis(bool value);
+ bool dlssgLite() const;
+ void setDlssgLite(bool value);
+ bool dlssgLiteAvailable() const;
+ QString dlssgLiteHint() const;
int contentRate() const;
void setContentRate(int value);
int displaySync() const;
diff --git a/qml/Veyra/Main.qml b/qml/Veyra/Main.qml
index 6db286c2..b44d234e 100644
--- a/qml/Veyra/Main.qml
+++ b/qml/Veyra/Main.qml
@@ -127,6 +127,12 @@ Window {
// Tell the bridge where the user is, so a command like "open a file" can
// behave differently from home than from the professional page.
if (veyra.currentPage !== page) veyra.currentPage = page
+ // A page the user picks while the Home panel is up ends it there: closing
+ // the panel later does not snap back to the page it was opened from.
+ if (quickPanel && !instantPage) {
+ quickReturnPage = ""
+ if (page !== "pro" && page !== "node") quickPanel = false
+ }
// Test the page itself: the cinema binding may not have caught up with
// this change yet, and a stale value shrank the page after min instead.
// Leaving 极简 gives the window back the height it had before (core.js
@@ -148,7 +154,7 @@ Window {
// later with its [data-in] items rising. Reduced motion shows it at once.
const prev = shownPage
if (prev === page) return
- leavingPage = Theme.reduced || prev === "" ? "" : prev
+ leavingPage = Theme.reduced || prev === "" || instantPage ? "" : prev
// Leaving a page without a picture (home, settings): an open may follow in
// the same call (openPath navigates, then opens) and the engine samples the
// host size once, so the rect is placed now, not 150 ms later. There is no
@@ -257,7 +263,7 @@ Window {
// Also follows wrapping status text and the compact header/transport.
onVideoViewportChanged: if (root.page === "pro" && !root.fullscreen) videoHost.syncRect()
home: pages
- overlay: root.quickPanelShown
+ overlay: root.quickPanelShown && root.page === "pro"
onRequestFullscreen: root.toggleFullscreen()
onRequestPage: p => root.goPage(p)
onRequestDialog: key => dialogs.open(key)
@@ -268,6 +274,7 @@ Window {
dragStripHeight: 14
home: pages
videoHeight: root.nodeVideoHeight
+ overlay: root.quickPanelShown && root.page === "node"
onVideoHeightEdited: h => { root.nodeVideoHeight = h; videoHost.syncRect() }
onRequestFullscreen: root.toggleFullscreen()
onRequestPage: p => root.goPage(p)
@@ -371,17 +378,38 @@ Window {
property bool fullTarget: false
property int fullRestoreVisibility: Window.Windowed
property bool fullLocked: false
- // Fullscreen quick-adjust panel (Home): the list mode's inspector on the left
- // of the picture, with the performance orbs. List mode only.
+ // Fullscreen quick-adjust panel (Home): the professional mode's own controls
+ // over the picture - the list inspector (with the performance orbs) in list
+ // mode, the node canvas along the bottom in node mode (veyra.nodeMode). From
+ // 极简 the professional page becomes current underneath the fullscreen picture
+ // while the panel is open, and 极简 returns when it closes.
property bool quickPanel: false
- readonly property bool quickPanelShown: fullscreen && quickPanel && page === "pro" && !fullLocked
+ property string quickReturnPage: ""
+ // A page change the user cannot see (under the fullscreen picture) skips the
+ // sink animation, so the old page never flashes over the picture.
+ property bool instantPage: false
+ readonly property bool quickPanelShown: fullscreen && quickPanel && (page === "pro" || page === "node") && !fullLocked
+ function switchPageInstantly(p) { instantPage = true; page = p; instantPage = false }
+ function toggleQuickPanel() {
+ if (quickPanel) { closeQuickPanel(); return }
+ const target = veyra.nodeMode === 1 ? "node" : "pro"
+ if (page !== target) {
+ if (page !== "pro" && page !== "node") quickReturnPage = page
+ switchPageInstantly(target)
+ }
+ quickPanel = true
+ }
+ function closeQuickPanel() {
+ quickPanel = false
+ if (quickReturnPage !== "") { const p = quickReturnPage; quickReturnPage = ""; switchPageInstantly(p) }
+ }
onQuickPanelShownChanged: veyra.logUi("ui-fullscreen", "quick panel shown=" + quickPanelShown)
onFullscreenChanged: {
veyra.setPresentationFullscreen(fullscreen)
fullTarget = fullscreen
if (!fullscreen) {
fullLocked = false
- quickPanel = false
+ closeQuickPanel()
if (cinema && !maximized) height = Math.round(pictureHeight)
}
fullControls = true
@@ -490,7 +518,7 @@ Window {
if (pressOnCover) return
if (root.page !== "min" && root.page !== "pro" && root.page !== "node" && !root.fullscreen) return
if (dialogs.dialog !== "" || !veyra.hasSource) return
- if (root.fullscreen && root.quickPanelShown && proPage.overlayContains(p.x, p.y)) return
+ if (root.fullscreen && root.quickPanelShown && (proPage.overlayContains(p.x, p.y) || nodePage.overlayContains(p.x, p.y))) return
if (!root.fullscreen && !root.pictureContains(p)) return
root.contentItem.forceActiveFocus()
if (veyra.isCapture || veyra.duration <= 0) return
@@ -506,7 +534,7 @@ Window {
const p = eventPoint.position
if (pressOnCover) return
if (root.fullscreen) {
- if (root.quickPanelShown && proPage.overlayContains(p.x, p.y)) return
+ if (root.quickPanelShown && (proPage.overlayContains(p.x, p.y) || nodePage.overlayContains(p.x, p.y))) return
root.toggleFullscreen()
return
}
@@ -602,14 +630,12 @@ Window {
}
Shortcut { sequences: ["F11", "Alt+Return", "Alt+Enter"]; onActivated: root.toggleFullscreen() }
Shortcut { sequence: "Esc"; enabled: root.fullscreen; onActivated: root.toggleFullscreen() }
- // Home: the fullscreen quick-adjust panel, list mode only.
+ // Home: the fullscreen quick-adjust panel, from 极简 or 专业 (list or node view).
Shortcut {
sequence: "Home"
- enabled: root.fullscreen && !root.fullLocked && dialogs.dialog === ""
- onActivated: {
- if (root.page !== "pro") { toast.show(qsTr("快速调节只在专业模式的列表视图可用"), false); return }
- root.quickPanel = !root.quickPanel
- }
+ enabled: root.fullscreen && !root.fullLocked && dialogs.dialog === "" &&
+ (root.page === "min" || root.page === "pro" || root.page === "node")
+ onActivated: root.toggleQuickPanel()
}
// 5 s steps (field request 2026-10-02).
Shortcut { sequence: "Left"; onActivated: veyra.seekBy(-5) }
diff --git a/qml/Veyra/NodePage.qml b/qml/Veyra/NodePage.qml
index e2fbfe69..71be30b4 100644
--- a/qml/Veyra/NodePage.qml
+++ b/qml/Veyra/NodePage.qml
@@ -21,6 +21,14 @@ VPage {
signal requestInspector(int nodeIndex, string nodeType)
signal requestFullscreen()
+ // Fullscreen quick-adjust (Home, Main.qml): only the canvas is shown, as a
+ // panel along the bottom of the picture, cut out of the native video window.
+ property bool overlay: false
+ function overlayContains(x, y) {
+ if (!overlay) return false
+ const p = canvasCard.mapToItem(root, 0, 0)
+ return x >= p.x && x <= p.x + canvasCard.width && y >= p.y && y <= p.y + canvasCard.height
+ }
property real panX: 220
property real panY: 0
property real zoom: 1.0
@@ -332,13 +340,24 @@ VPage {
onZoomChanged: { canvasGrid.requestPaint(); wires.requestPaint() }
ColumnLayout {
- anchors.fill: parent
+ id: nodeLayout
+ anchors.left: parent.left
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.bottom: parent.bottom
anchors.margins: 14
spacing: 0
+ states: State {
+ name: "overlay"
+ when: root.overlay
+ AnchorChanges { target: nodeLayout; anchors.top: undefined }
+ PropertyChanges { target: nodeLayout; height: Math.round(Math.max(260, root.height * 0.42)) }
+ }
// --- video card (fixed 330px) --------------------------------------
Rectangle {
id: nvTop
+ visible: !root.overlay
Layout.fillWidth: true
Layout.preferredHeight: root.videoHeight
radius: Theme.rCard
@@ -515,6 +534,7 @@ VPage {
// --- split handle (10px) -------------------------------------------
Item {
objectName: "node-splitter"
+ visible: !root.overlay
Layout.fillWidth: true
Layout.preferredHeight: 10
Rectangle {
@@ -543,6 +563,9 @@ VPage {
// --- canvas --------------------------------------------------------
Rectangle {
id: canvasCard
+ // Over the fullscreen picture the canvas is a cover like any panel.
+ readonly property bool videoCover: root.overlay
+ property real coverRadius: radius
Layout.fillWidth: true
Layout.fillHeight: true
radius: Theme.rCard
@@ -551,6 +574,19 @@ VPage {
border.color: Theme.stroke
clip: true
+ Text {
+ objectName: "node-quick-hint"
+ z: 100
+ visible: root.overlay
+ anchors.right: parent.right
+ anchors.top: parent.top
+ anchors.margins: 12
+ text: qsTr("Home 关闭")
+ color: Theme.t3
+ font.family: Theme.fontUi
+ font.pixelSize: 11
+ }
+
// .canvas dot grid: 22px spacing, drawn over the viewport only, since
// an "infinite" canvas is a feel and infinite dots would cost frames.
Canvas {
@@ -1555,6 +1591,14 @@ VPage {
onPicked: id => veyra.fgMultiplier = Number(id)
}
}
+ VRow {
+ label: qsTr("DLSS 性能模式")
+ visible: veyra.fgBackendName === "dlss"
+ enabled: veyra.dlssgLiteAvailable
+ opacity: enabled ? 1 : 0.5
+ hint: veyra.dlssgLiteHint
+ VSwitch { objectName: "node-dlssg-lite"; checked: veyra.dlssgLite; onToggled: checked => veyra.dlssgLite = checked }
+ }
VRow {
label: qsTr("VFG 质量")
visible: veyra.fgBackendName === "vfg"
diff --git a/qml/Veyra/ProPage.qml b/qml/Veyra/ProPage.qml
index b35f60ce..20de5624 100644
--- a/qml/Veyra/ProPage.qml
+++ b/qml/Veyra/ProPage.qml
@@ -1751,6 +1751,18 @@ VPage {
onPicked: id => veyra.fgMultiplier = Number(id)
}
}
+ VRow {
+ label: qsTr("DLSS 性能模式")
+ visible: veyra.fgBackendName === "dlss"
+ enabled: veyra.dlssgLiteAvailable
+ opacity: enabled ? 1 : 0.5
+ hint: veyra.dlssgLiteHint
+ VSwitch {
+ objectName: "list-dlssg-lite"
+ checked: veyra.dlssgLite
+ onToggled: checked => veyra.dlssgLite = checked
+ }
+ }
VRow {
label: qsTr("VFG 质量")
visible: veyra.fgBackendName === "vfg"
diff --git a/qml/Veyra/SettingsPage.qml b/qml/Veyra/SettingsPage.qml
index 186f403c..fe3cf6ae 100644
--- a/qml/Veyra/SettingsPage.qml
+++ b/qml/Veyra/SettingsPage.qml
@@ -632,6 +632,15 @@ VPage {
onPicked: id => veyra.setPreference("monitorGpu", id)
}
}
+ VRow {
+ label: qsTr("同时用这块显卡运算")
+ hint: veyra.computeGpuHint
+ VSwitch {
+ objectName: "set-compute-gpu"
+ checked: veyra.preferences.computeOnMonitorGpu === true
+ onToggled: v => veyra.setPreference("computeOnMonitorGpu", v)
+ }
+ }
VRow {
label: qsTr("全屏显存增长保护")
hint: qsTr("检测异常增长时自动退出全屏;默认关闭")
diff --git a/src/engine/EffectChain.cpp b/src/engine/EffectChain.cpp
index a7e9b7d1..52703b33 100644
--- a/src/engine/EffectChain.cpp
+++ b/src/engine/EffectChain.cpp
@@ -648,6 +648,7 @@ bool requiresGraphRebuild(const EnhancementSettings& savedPrevious, const Enhanc
if (previous.opticalFlowBackend != next.opticalFlowBackend) return true;
if (previous.amdFlowHalfResolution != next.amdFlowHalfResolution) return true;
if (previous.fgMotionRefine != next.fgMotionRefine) return true;
+ if (previous.dlssgLite != next.dlssgLite) return true;
if (previous.flow != next.flow) return true;
if (previous.captureCompatible != next.captureCompatible) return true;
if (previous.forceSdrPreview != next.forceSdrPreview) return true;
diff --git a/src/engine/EngineController.cpp b/src/engine/EngineController.cpp
index b9aa2280..8ca9adc8 100644
--- a/src/engine/EngineController.cpp
+++ b/src/engine/EngineController.cpp
@@ -364,6 +364,9 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s
!path.starts_with(L"capture:")&&!path.starts_with(L"capture2:")&&!path.starts_with(L"screen:")&&
extension!=L".png"&&extension!=L".jpg"&&extension!=L".jpeg";
if(!prewarmEnabled_||!ordinaryFile)prewarmed_.reset();
+ // A prewarmed session belongs to the adapter that was preferred when it
+ // started; a different compute GPU choice opens a new one.
+ if(prewarmed_&&prewarmed_->context.initialized()&&gfx::preferredAdapterLuid()&&prewarmed_->context.adapter().luid!=gfx::preferredAdapterLuid())prewarmed_.reset();
auto gpu=prewarmed_?std::move(prewarmed_):std::make_unique<PreviewGpuSession>();
auto& ctx=gpu->context;auto& ring=gpu->ring;source::MediaFileSource source;
sink::AudioPipeline audioPipe;sink::AudioRenderer audio;VideoPresenter presenter;
@@ -747,6 +750,7 @@ void EngineController::run(HWND window,std::wstring path,PlayerOptions options,s
fgMultiFrameMaxCap_=graph->fgMultiFrameCountMax();
snapshot_.fgMultiFrameMax=fgMultiFrameMaxCap_;
snapshot_.fgCapabilityKnown=fgMultiFrameMaxCap_>0;
+ snapshot_.dlssgLiteState=graph->dlssgLiteState();
const auto xessState=gfx::XessMfgUnlock::snapshot();
// Unknown until the XeSS provider actually ran: a DLSS-only
// session must not restrict the XeSS choices in the UI.
diff --git a/src/engine/VideoExportJob.cpp b/src/engine/VideoExportJob.cpp
index 0dccc307..87ee3463 100644
--- a/src/engine/VideoExportJob.cpp
+++ b/src/engine/VideoExportJob.cpp
@@ -107,6 +107,8 @@ bool exportVideo(const std::wstring& input,const std::wstring& output,PlayerOpti
StageRequest stages;stages.nr=options.nr;stages.sr=options.sr;stages.fg=options.fg;stages.fgMultiplier=options.fgMultiplier;
stages.width=info.width;stages.height=info.height;stages.exportJob=true;stages.nvidiaAdapter=nvidiaAdapter;stages.amdNr=amdNrExport;
const auto plan=describeStages(stages,options.snapshot(),gd);
+ // Export keeps the standard DLSS-G model: quality first, no latency to save.
+ gd.dlssgLite=false;
if(!nvidiaFeatures&&gd.opticalFlowBackend==OpticalFlowBackend::Nvidia)gd.opticalFlowBackend=OpticalFlowBackend::AmdFidelityFx;
const auto resolution=plan;
// Availability comes from the shared stage contract: native-size RTX
diff --git a/src/gfx/D3D12DeviceContext.cpp b/src/gfx/D3D12DeviceContext.cpp
index 887a0fb7..b6a4bd5c 100644
--- a/src/gfx/D3D12DeviceContext.cpp
+++ b/src/gfx/D3D12DeviceContext.cpp
@@ -1,4 +1,5 @@
#include "veyra/gfx/D3D12DeviceContext.h"
+#include <cwchar>
#include <windows.h>
#include <winevt.h>
@@ -118,6 +119,19 @@ D3D12DeviceContext::~D3D12DeviceContext()
shutdown();
}
+void setPreferredAdapterLuid(uint64_t luid)
+{
+ if (!luid) { SetEnvironmentVariableW(L"VEYRA_COMPUTE_ADAPTER_LUID", nullptr); return; }
+ SetEnvironmentVariableW(L"VEYRA_COMPUTE_ADAPTER_LUID", std::format(L"{:016X}", luid).c_str());
+}
+
+uint64_t preferredAdapterLuid()
+{
+ wchar_t text[32]{};
+ const DWORD length = GetEnvironmentVariableW(L"VEYRA_COMPUTE_ADAPTER_LUID", text, 32);
+ return length && length < 32 ? std::wcstoull(text, nullptr, 16) : 0;
+}
+
bool D3D12DeviceContext::initialize(const DeviceContextDesc& desc, Status& status)
{
if (initialized_) {
@@ -157,8 +171,12 @@ bool D3D12DeviceContext::initialize(const DeviceContextDesc& desc, Status& statu
}
// Keep every backend on one hardware adapter. Never silently use WARP.
+ // The user's compute adapter (preferredAdapterLuid) is tried first when
+ // the caller did not pin one; the default order remains the fallback.
DXGI_ADAPTER_DESC1 chosenDesc{};
bool chosen = false;
+ const uint64_t preferred = desc.requiredLuid ? 0 : preferredAdapterLuid();
+ for (int pass = preferred ? 0 : 1; pass < 2 && !chosen; ++pass)
for (UINT index = 0;; ++index) {
ComPtr<IDXGIAdapter1> candidate;
const HRESULT enumResult = factory_->EnumAdapterByGpuPreference(
@@ -187,6 +205,7 @@ bool D3D12DeviceContext::initialize(const DeviceContextDesc& desc, Status& statu
narrow(candidateDesc.Description)));
const auto candidateLuid=(uint64_t(uint32_t(candidateDesc.AdapterLuid.HighPart))<<32)|candidateDesc.AdapterLuid.LowPart;
+ if (pass == 0 && candidateLuid != preferred) continue;
if ((!desc.requiredVendorId||candidateDesc.VendorId==desc.requiredVendorId) &&
(!desc.requiredLuid||candidateLuid==desc.requiredLuid) && !isSoftware &&
SUCCEEDED(D3D12CreateDevice(candidate.Get(),D3D_FEATURE_LEVEL_12_0,__uuidof(ID3D12Device),nullptr))) {
@@ -202,6 +221,11 @@ bool D3D12DeviceContext::initialize(const DeviceContextDesc& desc, Status& statu
veyra::log::error("gfx", "no compatible requested D3D12 hardware adapter found");
return false;
}
+ if (preferred) {
+ const auto luid = (uint64_t(uint32_t(chosenDesc.AdapterLuid.HighPart)) << 32) | chosenDesc.AdapterLuid.LowPart;
+ (luid == preferred ? veyra::log::info : veyra::log::warn)("gfx", std::format("compute adapter preference={:016X} used={} desc={}",
+ preferred, luid == preferred ? "yes" : "no (unavailable; default order)", narrow(chosenDesc.Description)));
+ }
fillAdapterInfo(chosenDesc, adapterInfo_);
// 4. Device at minimum feature level 12_0, reporting the highest level.
diff --git a/src/ngx/DlssFgBackend.cpp b/src/ngx/DlssFgBackend.cpp
index 0c2e877e..78ac83d5 100644
--- a/src/ngx/DlssFgBackend.cpp
+++ b/src/ngx/DlssFgBackend.cpp
@@ -15,6 +15,7 @@
#include "veyra/NgxResult.h"
#include "veyra/ngx/NgxCoreHost.h"
#include "veyra/ngx/FgCompatibilitySession.h"
+#include "veyra/ngx/DlssgLite.h"
namespace veyra::ngx {
@@ -226,6 +227,10 @@ bool DlssFgBackend::create(NgxCoreHost& coreHost,
NVSDK_NGX_DLSSG_ResourceFlags_BidirectionalDistortionField;
params->Set(NVSDK_NGX_DLSSG_Parameter_ResourceAlwaysProvided_Flags, alwaysFlags);
params->Set(NVSDK_NGX_DLSSG_Parameter_ResourceNeverProvided_Flags, neverFlags);
+ // Performance mode: read by the 310.9.16 runtime at create only; older
+ // runtimes ignore the name. Always written so a reused block never keeps it.
+ params->Set(kDlssgLiteParameter, desc.lite ? 1u : 0u);
+ log::info("ngx", std::format("fg-backend: {}={}", kDlssgLiteParameter, desc.lite ? 1 : 0));
log::info("ngx", std::format("fg-backend: ResourceAlwaysProvided=0x{:X} ResourceNeverProvided=0x{:X}",
alwaysFlags, neverFlags));
diff --git a/src/ngx/NgxCoreHost.cpp b/src/ngx/NgxCoreHost.cpp
index 0f12fda7..d5c2d820 100644
--- a/src/ngx/NgxCoreHost.cpp
+++ b/src/ngx/NgxCoreHost.cpp
@@ -98,7 +98,8 @@ bool NgxCoreHost::initialize(ID3D12Device* device,
const std::wstring& runtimeDir,
const char* projectId,
const char* engineVersion,
- Status& status)
+ Status& status,
+ const std::wstring& priorityDirectory)
{
if (initialized_) {
status = Status::InvalidArgument;
@@ -111,10 +112,11 @@ bool NgxCoreHost::initialize(ID3D12Device* device,
return false;
}
- const wchar_t* featurePaths[] = { runtimeDir.c_str() };
+ const bool priority = !priorityDirectory.empty();
+ const wchar_t* featurePaths[] = { priority ? priorityDirectory.c_str() : runtimeDir.c_str(), runtimeDir.c_str() };
NVSDK_NGX_FeatureCommonInfo common{};
common.PathListInfo.Path = const_cast<const wchar_t**>(featurePaths);
- common.PathListInfo.Length = 1;
+ common.PathListInfo.Length = priority ? 2 : 1;
if (GetEnvironmentVariableW(L"VEYRA_TEST_NGX_VERBOSE", nullptr, 0)) {
common.LoggingInfo.LoggingCallback = runtimeLog;
common.LoggingInfo.MinimumLoggingLevel = NVSDK_NGX_LOGGING_LEVEL_ON;
@@ -126,8 +128,8 @@ bool NgxCoreHost::initialize(ID3D12Device* device,
engineVersion, runtimeDir.c_str(), device, &common, NVSDK_NGX_Version_API, sehCode);
initResult_ = static_cast<uint64_t>(result);
- veyra::log::info("ngx", std::format("core-host: Init_with_ProjectID result={} seh={} runtimeDirLen={} projectId={}",
- veyra::ngxResultString(initResult_), sehCode, runtimeDir.size(), projectId));
+ veyra::log::info("ngx", std::format("core-host: Init_with_ProjectID result={} seh={} runtimeDirLen={} projectId={} priorityDirLen={}",
+ veyra::ngxResultString(initResult_), sehCode, runtimeDir.size(), projectId, priorityDirectory.size()));
if (result != NVSDK_NGX_Result_Success) {
status = Status::DeviceFailure;
diff --git a/src/pipeline/EnhanceGraph.cpp b/src/pipeline/EnhanceGraph.cpp
index ffbb9040..89c26441 100644
--- a/src/pipeline/EnhanceGraph.cpp
+++ b/src/pipeline/EnhanceGraph.cpp
@@ -39,6 +39,7 @@
#include "veyra/ngx/VideoSrBackend.h"
#include "veyra/ngx/TrueHdrBackend.h"
#include "veyra/ngx/NgxCoreHost.h"
+#include "veyra/ngx/DlssgLite.h"
#include "veyra/ngx/NgxCoreCache.h"
#include "veyra/ngx/NgxParameters.h"
#include "veyra/ngx/NvOfSession.h"
@@ -1097,9 +1098,20 @@ bool EnhanceGraph::initNgxFeatures()
{
Status st = Status::Ok;
failedBackend_=engine::FailedBackend::NgxCore;
+ // DLSS-G performance mode: its runtime directory is searched before the
+ // default one, so the NGX core (and its cache key) depends on it.
+ dlssgLiteState_=0;dlssgDirectory_.clear();
+ if(desc_.enableFg&&desc_.frameGenerationBackend==engine::FrameGenerationBackend::Dlss&&desc_.dlssgLite){
+ if(ngx::FgCompatibilitySession::requested(context_.adapter().vendorId,context_.adapter().deviceId))dlssgLiteState_=3;
+ else if(!ngx::dlssgLiteRuntimePresent(desc_.runtimeAbsPath))dlssgLiteState_=2;
+ else{dlssgLiteState_=1;dlssgDirectory_=std::filesystem::absolute(ngx::dlssgLiteDirectory(desc_.runtimeAbsPath)).lexically_normal().wstring();}
+ veyra::log::info("dlssg-lite",std::format("requested=1 state={} ({}) directory={}",dlssgLiteState_,
+ dlssgLiteState_==1?"active":dlssgLiteState_==2?"runtime missing":"GPU keeps the default runtime",
+ utf8Of(dlssgDirectory_)));
+ }
if(coreCache_){
ngx::NgxCoreCache::Key key;
- key.device=context_.device();
+ key.device=context_.device();key.dlssgDirectory=dlssgDirectory_;
key.runtimeDirectory=std::filesystem::absolute(desc_.runtimeAbsPath).lexically_normal().wstring();
key.nrRuntime=int(engine::currentNrRuntime(desc_.nrRuntime));
key.frameGeneration=desc_.enableFg;
@@ -1178,7 +1190,7 @@ bool EnhanceGraph::initNgxFeatures()
coreHost_ = std::make_shared<ngx::NgxCoreHost>();
if(fgCompatibility_&&!fgCompatibility_->beginInitialization())return false;
const bool initialized=coreHost_->initialize(context_.device(), desc_.runtimeAbsPath.c_str(),
- projectId.c_str(), engineVersion.c_str(), st);
+ projectId.c_str(), engineVersion.c_str(), st, dlssgDirectory_);
const bool initRestored=!fgCompatibility_||fgCompatibility_->endInitialization(initialized);
if (!initialized || !initRestored) {
return false;
@@ -1358,6 +1370,7 @@ bool EnhanceGraph::initNgxFeatures()
fd.width = workW_; fd.height = workH_;
fd.renderWidth = workW_; fd.renderHeight = workH_;
fd.backbufferFormat = outputFormat();
+ fd.lite = dlssgLiteState_==1;
ID3D12GraphicsCommandList* list = ring_.acquire(0, st);
if (list == nullptr) { failedBackend_=engine::FailedBackend::Infrastructure; return false; }
failedBackend_=engine::FailedBackend::Fg;
@@ -3219,6 +3232,8 @@ bool EnhanceGraph::applySettings(const engine::EnhancementSettings& s){
if(usesSharedFlow&&(requestedFlow!=desc_.opticalFlowBackend||s.amdFlowHalfResolution!=desc_.amdFlowHalfResolution))return false;
// The XeSS motion refinement owns textures, passes and NVOF's direction.
if(presentSinkFg()&&desc_.fgUsesFlow()&&s.fgMotionRefine!=desc_.fgMotionRefine)return false;
+ // The DLSS-G performance mode selects the runtime and a create-time parameter.
+ if(desc_.enableFg&&desc_.frameGenerationBackend==engine::FrameGenerationBackend::Dlss&&s.dlssgLite!=desc_.dlssgLite)return false;
// DLSS allocates multiplier-specific feature/output resources.
// XeSS has a fixed 2X proxy swapchain contract. Settings callers must
// rebuild instead of accepting a change that cannot take effect in place.
diff --git a/src/ui/QmlPlayerBridge.cpp b/src/ui/QmlPlayerBridge.cpp
index cb74898c..5f9bc9d0 100644
--- a/src/ui/QmlPlayerBridge.cpp
+++ b/src/ui/QmlPlayerBridge.cpp
@@ -1,6 +1,8 @@
#include "veyra/ui/QmlPlayerBridge.h"
#include "veyra/gfx/PresentSink.h"
#include "veyra/gfx/NvidiaVrr.h"
+#include "veyra/ngx/DlssgLite.h"
+#include "veyra/RuntimePaths.h"
#include <QElapsedTimer>
#include "veyra/ui/EffectAvailability.h"
#include "veyra/engine/FrameGenerationSelection.h"
@@ -448,6 +450,21 @@ struct QmlPlayerBridge::Impl {
id.toStdString(), uint32_t(d.AdapterLuid.HighPart), d.AdapterLuid.LowPart, d.DedicatedVideoMemory >> 20));
}
}
+ // The monitored GPU also computes when 设置 -> "同时用这块显卡运算" is on
+ // and a specific GPU (not 自动) is chosen; otherwise the default order.
+ QString computeGpuName;
+ uint64_t computeLuid = 0;
+ void applyComputeGpu() {
+ const QString wanted = prefString("monitorGpu");
+ const GpuAdapter* chosen = nullptr;
+ for (const auto& a : gpuAdapters) if (!wanted.isEmpty() && a.id == wanted) chosen = &a;
+ const bool follow = prefBool("computeOnMonitorGpu", false) && chosen;
+ computeLuid = follow ? (uint64_t(chosen->luidHigh) << 32 | chosen->luidLow) : 0;
+ computeGpuName = follow ? chosen->name : QString();
+ gfx::setPreferredAdapterLuid(computeLuid);
+ veyra::log::info("perf", std::format("compute gpu follow={} wanted={} using={}", follow, wanted.isEmpty() ? "auto" : wanted.toStdString(),
+ follow ? chosen->name.toStdString() : "default order (highest-performance adapter)"));
+ }
void resolveGpuMonitor() {
const QString wanted = prefString("monitorGpu");
const GpuAdapter* chosen = gpuAdapters.empty() ? nullptr : &gpuAdapters.front();
@@ -868,21 +885,37 @@ static uint32_t primaryGpuVendor() {
// FSR 4 ML frame generation needs an AMD RX 9000; on other GPUs the provider crashed the
// whole program (field report 2026-10-01). Known non-AMD adapters are refused up front.
static bool fsr4Possible() { return currentEffectCapabilities().value("fsr4").toMap().value("available").toBool(); }
-// The menu checks the same default DXGI preference as the engine. The native
-// backend then verifies CUDA compute capability and the exact adapter LUID.
-static bool vfgHardwarePossible(){
- static const bool supported=[] {
- Microsoft::WRL::ComPtr<IDXGIFactory6> factory;
- if(FAILED(CreateDXGIFactory1(IID_PPV_ARGS(&factory))))return false;
+// The adapter the engine opens: the user's compute GPU when one is chosen
+// (gfx::preferredAdapterLuid) and usable, else the first D3D12 hardware
+// adapter in DXGI's high-performance order, as D3D12DeviceContext picks it.
+// UI thread only; cached per preference.
+static const DXGI_ADAPTER_DESC1* engineAdapterDesc(){
+ static uint64_t cachedFor=~0ull;static DXGI_ADAPTER_DESC1 cached{};static bool found=false;
+ const uint64_t preferred=gfx::preferredAdapterLuid();
+ if(cachedFor==preferred)return found?&cached:nullptr;
+ cachedFor=preferred;found=false;
+ Microsoft::WRL::ComPtr<IDXGIFactory6> factory;
+ if(FAILED(CreateDXGIFactory1(IID_PPV_ARGS(&factory))))return nullptr;
+ for(int pass=preferred?0:1;pass<2&&!found;++pass)
for(UINT i=0;;++i){Microsoft::WRL::ComPtr<IDXGIAdapter1> adapter;
- if(factory->EnumAdapterByGpuPreference(i,DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE,IID_PPV_ARGS(&adapter))==DXGI_ERROR_NOT_FOUND)break;
- if(!adapter)break;DXGI_ADAPTER_DESC1 d{};
- if(FAILED(adapter->GetDesc1(&d))||(d.Flags&DXGI_ADAPTER_FLAG_SOFTWARE)||FAILED(D3D12CreateDevice(adapter.Get(),D3D_FEATURE_LEVEL_12_0,__uuidof(ID3D12Device),nullptr)))continue;
- const auto name=QString::fromWCharArray(d.Description);
- return d.VendorId==0x10DE&&(name.contains(QStringLiteral("GeForce RTX 40"),Qt::CaseInsensitive)||
- name.contains(QStringLiteral("GeForce RTX 50"),Qt::CaseInsensitive)||name.contains(QStringLiteral("Ada"),Qt::CaseInsensitive)||name.contains(QStringLiteral("Blackwell"),Qt::CaseInsensitive));
- }return false;
- }();return supported;
+ if(FAILED(factory->EnumAdapterByGpuPreference(i,DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE,IID_PPV_ARGS(&adapter)))||!adapter)break;
+ DXGI_ADAPTER_DESC1 d{};
+ if(FAILED(adapter->GetDesc1(&d))||(d.Flags&DXGI_ADAPTER_FLAG_SOFTWARE))continue;
+ const uint64_t luid=uint64_t(uint32_t(d.AdapterLuid.HighPart))<<32|d.AdapterLuid.LowPart;
+ if(pass==0&&luid!=preferred)continue;
+ if(FAILED(D3D12CreateDevice(adapter.Get(),D3D_FEATURE_LEVEL_12_0,__uuidof(ID3D12Device),nullptr)))continue;
+ cached=d;found=true;break;
+ }
+ return found?&cached:nullptr;
+}
+// The menu checks the same adapter as the engine. The native backend then
+// verifies CUDA compute capability and the exact adapter LUID.
+static bool vfgHardwarePossible(){
+ const auto* d=engineAdapterDesc();
+ if(!d)return false;
+ const auto name=QString::fromWCharArray(d->Description);
+ return d->VendorId==0x10DE&&(name.contains(QStringLiteral("GeForce RTX 40"),Qt::CaseInsensitive)||
+ name.contains(QStringLiteral("GeForce RTX 50"),Qt::CaseInsensitive)||name.contains(QStringLiteral("Ada"),Qt::CaseInsensitive)||name.contains(QStringLiteral("Blackwell"),Qt::CaseInsensitive));
}
static unsigned normalizeFgMultiplier(unsigned value,engine::FrameGenerationBackend backend,unsigned cap){
value=std::clamp(value,2u,cap);
@@ -891,28 +924,17 @@ static unsigned normalizeFgMultiplier(unsigned value,engine::FrameGenerationBack
bool QmlPlayerBridge::amdNrGpu() const { return primaryGpuVendor()==0x1002; }
static ui::EffectGpu effectGpu() {
- static const auto gpu = [] {
- ui::EffectGpu result;
- Microsoft::WRL::ComPtr<IDXGIFactory6> factory;
- if (FAILED(CreateDXGIFactory1(IID_PPV_ARGS(&factory)))) return result;
- for (UINT i = 0;; ++i) {
- Microsoft::WRL::ComPtr<IDXGIAdapter1> adapter;
- if (FAILED(factory->EnumAdapterByGpuPreference(i, DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE, IID_PPV_ARGS(&adapter)))) break;
- DXGI_ADAPTER_DESC1 d{};
- if (FAILED(adapter->GetDesc1(&d)) || (d.Flags & DXGI_ADAPTER_FLAG_SOFTWARE) ||
- FAILED(D3D12CreateDevice(adapter.Get(), D3D_FEATURE_LEVEL_12_0, __uuidof(ID3D12Device), nullptr))) continue;
- const auto name = QString::fromWCharArray(d.Description);
- result.vendor = d.VendorId;
- result.deviceId = d.DeviceId;
- result.rtx = name.contains("RTX", Qt::CaseInsensitive);
- result.blackwell = name.contains("RTX 50", Qt::CaseInsensitive) || name.contains("Blackwell", Qt::CaseInsensitive);
- result.ada = name.contains("RTX 40", Qt::CaseInsensitive) || name.contains("Ada", Qt::CaseInsensitive);
- result.rx9000 = name.contains("RX 90", Qt::CaseInsensitive);
- break;
- }
- return result;
- }();
- return gpu;
+ ui::EffectGpu result;
+ const auto* d = engineAdapterDesc();
+ if (!d) return result;
+ const auto name = QString::fromWCharArray(d->Description);
+ result.vendor = d->VendorId;
+ result.deviceId = d->DeviceId;
+ result.rtx = name.contains("RTX", Qt::CaseInsensitive);
+ result.blackwell = name.contains("RTX 50", Qt::CaseInsensitive) || name.contains("Blackwell", Qt::CaseInsensitive);
+ result.ada = name.contains("RTX 40", Qt::CaseInsensitive) || name.contains("Ada", Qt::CaseInsensitive);
+ result.rx9000 = name.contains("RX 90", Qt::CaseInsensitive);
+ return result;
}
static QVariantMap scanEffectCapabilities() {
@@ -1081,6 +1103,12 @@ QmlPlayerBridge::QmlPlayerBridge(engine::EngineController& engine, std::filesyst
connect(impl_->playlist, &PlaylistModel::error, this, [this](const QString& text) {
veyra::log::warn("playlist", text.toStdString()); emit notice(text, true);
});
+ // The compute GPU decides which effects exist, so it is settled before
+ // anything below samples the capabilities or restores the saved chain.
+ impl_->loadPrefs();
+ impl_->enumerateGpuAdapters();
+ impl_->resolveGpuMonitor();
+ impl_->applyComputeGpu();
connect(this,&QmlPlayerBridge::snapshotChanged,this,
[this,ceiling=fgMaxMultiplier(),text=fgProviderText()]() mutable {
const auto nextCeiling=fgMaxMultiplier();const auto nextText=fgProviderText();
@@ -1100,12 +1128,9 @@ QmlPlayerBridge::QmlPlayerBridge(engine::EngineController& engine, std::filesyst
reported=next;emit effectCapabilitiesChanged();emit fgChoicesChanged();
});
capabilityTimer->start(2000);
- impl_->loadPrefs();
applyPreference(QStringLiteral("gpuPriority"));
applyPreference(QStringLiteral("prewarmEnhancement"));
impl_->engine.setFullscreenMemoryProtection(impl_->prefBool("fullscreenMemoryProtection",false));
- impl_->enumerateGpuAdapters();
- impl_->resolveGpuMonitor();
connect(&impl_->exportQueue,&QmlExportQueueModel::changed,this,&QmlPlayerBridge::exportChanged);
if (qApp) qApp->installEventFilter(this);
#ifdef VEYRA_ENABLE_MOONLIGHT
@@ -1225,6 +1250,10 @@ QmlPlayerBridge::QmlPlayerBridge(engine::EngineController& engine, std::filesyst
const bool on = p.value(QStringLiteral("edgeAegis")).toBool();
if (s.fgMotionRefine != on) { s.fgMotionRefine = on; changed = true; }
}
+ if (p.contains(QStringLiteral("dlssgPerformance"))) {
+ const bool on = p.value(QStringLiteral("dlssgPerformance")).toBool();
+ if (s.dlssgLite != on) { s.dlssgLite = on; changed = true; }
+ }
if (!defaultFlowApplied && p.contains(QStringLiteral("contentRate"))) {
const int rate = p.value(QStringLiteral("contentRate")).toInt();
if (rate >= 0 && rate <= int(engine::ContentRate::Capture60To30) && int(s.content) != rate) { s.content = static_cast<engine::ContentRate>(rate); changed = true; }
@@ -5305,7 +5334,7 @@ bool QmlPlayerBridge::setPreference(const QString& key, const QVariant& value) {
{"listInspectorWidth", {376, 4000}}};
static const QStringList flags{"subtitleEnabled", "subtitleBackground", "subtitleFit",
"subtitleSecondLanguage", "audioForceStereo", "holdCompare",
- "magewellLowLatency", "blackmagicNativeCapture", "cinePillHidden", "exportStopsPlayback", "obsGameCapture", "autoResume", "fullscreenMemoryProtection", "prewarmEnhancement", "hdrFgCompatibility"};
+ "magewellLowLatency", "blackmagicNativeCapture", "cinePillHidden", "exportStopsPlayback", "obsGameCapture", "autoResume", "fullscreenMemoryProtection", "prewarmEnhancement", "hdrFgCompatibility", "computeOnMonitorGpu"};
QVariant stored;
if (ranges.contains(key)) {
bool ok = false; const int n = value.toInt(&ok);
@@ -5423,7 +5452,47 @@ void QmlPlayerBridge::applyPreference(const QString& key) {
impl_->exportQueue.refresh();
}
}
- else if (key == QLatin1String("monitorGpu")) { impl_->resolveGpuMonitor(); impl_->gpuUtil = -1.0; emit perfChanged(); }
+ else if (key == QLatin1String("monitorGpu") || key == QLatin1String("computeOnMonitorGpu")) {
+ if (key == QLatin1String("monitorGpu")) { impl_->resolveGpuMonitor(); impl_->gpuUtil = -1.0; emit perfChanged(); }
+ const auto before = impl_->computeLuid;
+ impl_->applyComputeGpu();
+ if (impl_->computeLuid != before) {
+ // Effect availability follows the compute GPU (NVIDIA-only effects on another card).
+ (void)currentEffectCapabilities(true);
+ // The chain is checked against the new card the way a restart checks it:
+ // DLSS moves to an available backend, NVOF to FidelityFX flow, and stages
+ // the card cannot run are switched off with their parameters kept.
+ auto candidate = impl_->currentSession();
+ const auto previous = candidate;
+ QStringList disabled;
+ for (auto& configuration : candidate.configurations) {
+ const auto reason = disableUnavailableEffects(configuration);
+ if (!reason.isEmpty()) disabled << reason;
+ }
+ if (candidate != previous) {
+ auto next = impl_->facade.pendingSettings();
+ const auto& configuration = candidate.configurations[size_t(candidate.active)];
+ configuration.apply(next);
+ if (next.validate().empty() && impl_->facade.applySettings(next, engine::runtimeOrder(configuration.chain))) {
+ impl_->session = candidate;
+ impl_->restoreConfiguration(configuration);
+ impl_->revalidate();
+ impl_->options = engine::PlayerOptions::from(next, engine::runtimeOrder(impl_->activeRuntime()));
+ if (!impl_->persistSession()) veyra::log::warn("effect-availability", "compute gpu refit not saved");
+ emit chainChanged(); emit settingsChanged();
+ } else veyra::log::warn("effect-availability", "compute gpu refit not accepted; chain unchanged");
+ if (!disabled.isEmpty()) {
+ const auto message = tr("已关闭当前硬件或包不支持的效果,参数仍保留:") + disabled.join("; ");
+ veyra::log::warn("effect-availability", message.toStdString());
+ emit notice(message, false);
+ }
+ }
+ emit effectCapabilitiesChanged(); emit fgChoicesChanged();
+ if (impl_->snapshot.running)
+ emit notice(impl_->computeLuid ? tr("运算显卡已切换为「%1」,重新打开视频后生效").arg(impl_->computeGpuName)
+ : tr("运算显卡已恢复默认(性能最强的显卡),重新打开视频后生效"), false);
+ }
+ }
}
QVariantList QmlPlayerBridge::gpuMonitorChoices() const {
QVariantList out;
@@ -5432,6 +5501,11 @@ QVariantList QmlPlayerBridge::gpuMonitorChoices() const {
return out;
}
QString QmlPlayerBridge::gpuMonitorName() const { return impl_->gpuMonitorName; }
+QString QmlPlayerBridge::computeGpuHint() const {
+ if (!impl_->prefBool("computeOnMonitorGpu", false)) return tr("关闭时增强、补帧和导出用性能最强的显卡");
+ if (impl_->computeLuid) return tr("增强、补帧和导出都在「%1」上运行;切换后重新打开视频生效").arg(impl_->computeGpuName);
+ return tr("上面选“自动”时仍用性能最强的显卡;选一块显卡后它也负责运算");
+}
QString QmlPlayerBridge::uiLanguage() const { return i18n::current(); }
void QmlPlayerBridge::setQmlEngine(QQmlEngine* engine) {
impl_->qmlEngine = engine;
@@ -6768,6 +6842,27 @@ void QmlPlayerBridge::setEdgeAegis(bool value) {
if (!impl_->savePrefs()) veyra::log::warn("ui-prefs", "edge aegis not saved");
emit settingsChanged();
}
+bool QmlPlayerBridge::dlssgLite() const { return settings().dlssgLite; }
+void QmlPlayerBridge::setDlssgLite(bool value) {
+ auto s = settings();
+ if (s.dlssgLite == value) return;
+ s.dlssgLite = value;
+ if (!impl_->commit(std::move(s))) { emit notice(tr("引擎未接受 DLSS 性能模式,原设置保留"), true); return; }
+ impl_->prefs[QStringLiteral("dlssgPerformance")] = value;
+ if (!impl_->savePrefs()) veyra::log::warn("ui-prefs", "DLSS performance mode not saved");
+ emit settingsChanged();
+}
+bool QmlPlayerBridge::dlssgLiteAvailable() const {
+ static const bool present = ngx::dlssgLiteRuntimePresent(runtime::localRuntimeDirectory());
+ return present;
+}
+QString QmlPlayerBridge::dlssgLiteHint() const {
+ if (!dlssgLiteAvailable()) return tr("此软件包没有附带性能模式所需的 DLSS 帧生成 310.9.16 运行库");
+ const auto& s = impl_->snapshot;
+ if (s.running && s.dlssgLiteState == 3) return tr("目前只支持 RTX 50 系列:40/30 系的多帧解锁只适用于原版运行库");
+ if (s.running && s.dlssgLiteState == 1) return tr("生效中:NVIDIA DLSS 帧生成性能模式(测试版)");
+ return tr("NVIDIA 新增的性能模式(测试版):补帧更省 GPU,高倍率更稳,画质可能略降;导出仍用标准模式");
+}
int QmlPlayerBridge::contentRate() const { return int(settings().content); }
void QmlPlayerBridge::setContentRate(int value) {
if (value < 0 || value > int(engine::ContentRate::Capture60To30)) return;