mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-18 12:08:38 +00:00
Free all DLSS size slots when the preset changes
evaluate's preset_dirty loop stopped at slot 3 of the five D.sizes entries, so a preset change left the features in slots 3 and 4 created with the old model: they kept running until the slot was evicted. The loop now covers the whole array through DLSS_SIZES instead of a literal. This is a plain bug fix with no switch: a preset change is a deliberate menu action, the loop frees the same entries it always did plus the two it missed, and nothing happens when the preset stays as it is. Built and run with the dlss_prewarm measurements; a preset change itself was not part of those runs. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
8aba3647e0
commit
a76bdf5e08
1 file changed
+2
-1
+2
-1
@@ -294,6 +294,7 @@ static struct {
|
||||
unsigned cfg_seen; // cfg_version when preset was read
|
||||
uint64_t last_eval_ns; // plat_now_ns of the previous evaluation (FrameTimeDeltaInMsec)
|
||||
} D = {.mv_ok = -1, .cfg_seen = ~0u};
|
||||
#define DLSS_SIZES (sizeof D.sizes / sizeof D.sizes[0])
|
||||
|
||||
const VkTexImage *vk_dlaa_swap_img;
|
||||
VkImageView vk_dlaa_swap_view;
|
||||
@@ -949,7 +950,7 @@ static void evaluate(VkExec *ex, const VkExecTarget *dst) {
|
||||
VkCommandBuffer cb = ex->cb;
|
||||
vk_exec_barrier(ex); // what drew the scene is done (no pass is open here)
|
||||
if (D.preset_dirty) { // another model: features are created with it, so every size gets a new one
|
||||
for (int i = 0; i < 3; i++)
|
||||
for (size_t i = 0; i < DLSS_SIZES; i++)
|
||||
if (D.sizes[i].out) free_size(&D.sizes[i]);
|
||||
D.last = NULL, D.preset_dirty = 0;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user