mirror of
https://github.com/tangerineturtle1/NX2navi.git
synced 2026-11-20 12:29:57 -04:00
Free the images of HDR, FSR 1 and SMAA once they are no longer used, instead of keeping them for the process.
Each made its images at the picture's or the scene's size the first time it ran and kept them until the process ended, also after the menu switched it off: - the HDR encode's picture and menu image (28 and 14 MiB at 2560x1440, 63 and 32 MiB at 2160 lines) now go when the swapchain is made without HDR, after a wait for the presents that may still read them; - FSR 1's two images (56 MiB, 127 MiB at 2160 lines) go after 300 presents it did not scale, with the same wait; - SMAA's three work images (35 MiB, 79 MiB at 2160 lines) go after 600 frames of another anti-aliasing, deferred past the submission being recorded. Each makes them anew when it runs again; one log line says when they go. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1143,6 +1143,22 @@ void vk_hdr_ui_compose(VkCommandBuffer cb, VkImageView dst_view, VkFormat fmt, u
|
||||
vkCmdEndRendering(cb);
|
||||
}
|
||||
|
||||
// The swapchain is made without HDR (gfx_present.c create_swapchain): the encode's picture and the menu's image at the
|
||||
// picture's size (28 and 14 MiB at 2560x1440, 63 and 32 MiB at 2160 lines) were kept for the process once HDR had been
|
||||
// on. They go now, after a wait for the presents that may still read them; HDR switched on again makes them anew.
|
||||
void vk_hdr_images_release(void) {
|
||||
VkCtx *c = vk_ctx();
|
||||
if (!c || (!H.out.img && !H.menu.img)) return;
|
||||
vk_queue_lock();
|
||||
vkDeviceWaitIdle(c->device);
|
||||
vk_queue_unlock();
|
||||
for (int i = 0; i < SLOTS; i++)
|
||||
if (H.src_view[i]) vkDestroyImageView(c->device, H.src_view[i], NULL), H.src_view[i] = VK_NULL_HANDLE;
|
||||
img_free(c, &H.out);
|
||||
img_free(c, &H.menu);
|
||||
rt_log("vk_hdr: HDR is off: the encode's images are freed");
|
||||
}
|
||||
|
||||
void vk_hdr_release(void) {
|
||||
VkCtx *c = vk_ctx();
|
||||
for (int i = 0; i < SLOTS; i++)
|
||||
|
||||
Reference in New Issue
Block a user