Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gpu/vk/dlss_checks.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ namespace mkwvk::dlss_checks {
/// (DLAA at 1, Ultra Performance at 3: 512x288 for 1536x864, 683x384 for 2048x1152). False while the output is not known
/// (0). The scene's camera and the actor motion take only these, and the upscale draws only these.
inline bool scene_size_fits(uint32_t w, uint32_t h, uint32_t ow, uint32_t oh) {
return w && h && ow && oh && w <= ow && h <= oh && (uint64_t)w * 3 >= ow && (uint64_t)h * 3 >= oh;
return w && h && ow && oh && w <= ow && h <= oh && (uint64_t)(w + 2) * 3 >= ow && (uint64_t)(h + 2) * 3 >= oh;
}

/// A DLSS quality mode's range of render sizes for an output (NGX_DLSS_GET_OPTIMAL_SETTINGS' smallest and largest)
Expand Down
2 changes: 1 addition & 1 deletion gpu/vk/vk_dlss.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,7 @@ bool hdr() {
return s.feature && s.feature_hdr;
}

const TemporalEngine kEngine{"NVIDIA DLSS", "DLSS", start, prepare, evaluate, release, memory, hdr};
const TemporalEngine kEngine{"NVIDIA DLSS", "DLSS", start, prepare, evaluate, release, memory, hdr, false, true};

} // namespace

Expand Down
2 changes: 2 additions & 0 deletions gpu/vk/vk_menu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1924,6 +1924,8 @@ void set_row(Row& r, int v, int dir, bool keep = true) {
// (hookshot: the samplers made again, at once: their anisotropy, and the upscalers' LOD bias, vk_draw.cpp upscale_lod_bias)
if (r.value == &opts.anisotropy || r.value == &opts.dlss || r.value == &opts.resolution || r.value == &opts.preset)
samplers_changed();
if (r.value == &opts.dlss || r.value == &opts.resolution || r.value == &opts.dlss_model)
temporal_reset_failure();
prompts_at_once(r); // (hookshot)
{ // (a row that takes a restart, or a preset that sets one: asked again at the next close)
int now[mr::kMax];
Expand Down
11 changes: 11 additions & 0 deletions gpu/vk/vk_temporal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,17 @@ int temporal_status(char* b, size_t n) {
return mode;
}

void temporal_reset_failure() {
State& s = st();
std::lock_guard lk(s.mu);
for (auto& k : s.engines) {
k.failed.store(false, std::memory_order_relaxed);
}
s.reason = nullptr;
s.reason_repeats = 0;
s.last_frame = 0;
}

void temporal_idle() {
State& s = st();
if (!s.holding.load(std::memory_order_relaxed)) return;
Expand Down
1 change: 1 addition & 0 deletions gpu/vk/vk_temporal.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ bool temporal_upscale(VkCommandBuffer cmd, uint64_t key, bool known, Texture* in
/// engine's own state, the chain's images and deferred frees are let go, so their video memory comes back. Nothing to do
/// costs one atomic load
void temporal_idle();
void temporal_reset_failure();

/// For the renderer's status line (vk_replay.cpp status_tick): while an engine draws, its details since the last call into b
/// ("; DLSS: jitter ..., actor motion ..., its images ... MB") and temporal_mode(); else 0 and b left alone
Expand Down
Loading