diff --git a/runtime/gfx_present.c b/runtime/gfx_present.c index 8afde4dd..622f3c69 100644 --- a/runtime/gfx_present.c +++ b/runtime/gfx_present.c @@ -1040,7 +1040,7 @@ static void present_image(VkImage src, VkImageLayout layout, VkFormat fmt, int w last_write = 0; record_thumb(cb, dst, slot); } - if (src) vk_fg_frame(cb, g_sc, g_sc_fmt, g_sc_ext, hudless, g_hl_view); // frame generation: this frame's preparation + if (src) vk_fg_frame(cb, g_sc, g_sc_fmt, g_sc_ext, hudless, g_hl_view, to); // frame generation: this frame's preparation if (src) output_rate(); if (src) vk_dlssg_frame(cb, g_sc_ext); // DLSS Frame Generation: constants and tags (vk_dlssg.c) sync_barrier(cb, dst, last, VK_IMAGE_LAYOUT_PRESENT_SRC_KHR, last_stage, last_write, VK_PIPELINE_STAGE_2_NONE, 0); diff --git a/runtime/nx2navi.ico b/runtime/nx2navi.ico index 610eec95..b6893777 100644 Binary files a/runtime/nx2navi.ico and b/runtime/nx2navi.ico differ diff --git a/runtime/vk_fg.cpp b/runtime/vk_fg.cpp index 68b3138c..e87a905f 100644 --- a/runtime/vk_fg.cpp +++ b/runtime/vk_fg.cpp @@ -157,7 +157,7 @@ static bool hdr_format(VkFormat f) { } extern "C" void vk_fg_frame(VkCommandBuffer cb, VkSwapchainKHR sc, VkFormat fmt, VkExtent2D ext, VkImage hudless, - VkImageView hudless_view) { + VkImageView hudless_view, const int pic[4]) { (void)hudless_view; if (!vk_fg_active()) return; vk_dlaa_hudless_wanted = 1; // the upscaling pass keeps a copy of the picture before the HUD (vk_dlaa.c hudless) @@ -205,7 +205,10 @@ extern "C" void vk_fg_frame(VkCommandBuffer cb, VkSwapchainKHR sc, VkFormat fmt, cfg.frameGenerationCallbackUserContext = &F.fg; cfg.frameGenerationEnabled = on != 0; cfg.allowAsyncWorkloads = false; - cfg.generationRect = {0, 0, (int32_t)ext.width, (int32_t)ext.height}; + // the picture's rectangle: with black bars beside or below it (a window of another shape) a generation over the + // whole swapchain warped the picture's edges into the bars + cfg.generationRect = pic && pic[2] > 0 && pic[3] > 0 ? FfxApiRect2D{pic[0], pic[1], pic[2], pic[3]} + : FfxApiRect2D{0, 0, (int32_t)ext.width, (int32_t)ext.height}; if (on && hudless) { VkFfxImage h = {hudless, fmt, ext.width, ext.height, 1}; cfg.HUDLessColor = image(&h); diff --git a/runtime/vk_fg.h b/runtime/vk_fg.h index b24d6903..ed91ae63 100644 --- a/runtime/vk_fg.h +++ b/runtime/vk_fg.h @@ -18,7 +18,10 @@ VkResult vk_fg_present(const VkPresentInfoKHR *pi); // on the game's queue, it // preparation (the frame's depth and motion vectors, vk_dlaa_fg_inputs) into cb. // hudless: this frame's picture without the HUD at the swapchain's size and format, in GENERAL (VK_NULL_HANDLE: none), // from which generation tells the HUD apart and keeps it out of the generated frames. -void vk_fg_frame(VkCommandBuffer cb, VkSwapchainKHR sc, VkFormat fmt, VkExtent2D ext, VkImage hudless, VkImageView hudless_view); +// pic: the picture's rectangle in the swapchain {x, y, w, h} (black bars around it when the window has another shape); +// frames are generated inside it only. +void vk_fg_frame(VkCommandBuffer cb, VkSwapchainKHR sc, VkFormat fmt, VkExtent2D ext, VkImage hudless, VkImageView hudless_view, + const int pic[4]); uint64_t vk_fg_presents(VkSwapchainKHR sc); // frames the swapchain presented, generated ones included (0: off) PFN_vkSetHdrMetadataEXT vk_fg_hdr_metadata_fn(void); // AMD's replacement for vkSetHdrMetadataEXT while active, else NULL void vk_fg_release(void);