mirror of
https://github.com/valentderah/totk-pc-recomp.git
synced 2026-11-23 05:25:56 +00:00
Implement Native NVIDIA Reflex Low Latency (VK_NV_low_latency2)
- Enable VK_NV_low_latency2 and VK_KHR_present_id with present ID features - Add VkSwapchainLatencyCreateInfoNV to swapchain creation - Link present and submission IDs with standard Vulkan latency types - Insert latency markers: simulation start/end, input sample, render submit, and present - Gate all extensions and latency chains on reflex != off (RESTART setting) - Log graceful notice when Reflex is requested on unsupported hardware - Add UI menu setting and translations for en, ru, pt-BR, zh-Hans - Document reflex setting in totk.ini.example and docs/settings.md
This commit is contained in:
1 parent
7a37fc3c34
commit
3209ea4358
12 files changed
+196
-9
No files matched your search
@@ -474,12 +474,20 @@ uint64_t vk_sync_submit(const uint64_t *handles, int n) {
|
||||
{.sType = VK_STRUCTURE_TYPE_COMMAND_BUFFER_SUBMIT_INFO, .commandBuffer = s->cb}};
|
||||
VkSemaphoreSubmitInfo sig = {.sType = VK_STRUCTURE_TYPE_SEMAPHORE_SUBMIT_INFO, .semaphore = c->timeline,
|
||||
.value = fence, .stageMask = VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT};
|
||||
VkLatencySubmissionPresentIdNV lsid = {
|
||||
.sType = VK_STRUCTURE_TYPE_LATENCY_SUBMISSION_PRESENT_ID_NV,
|
||||
.pNext = NULL,
|
||||
.presentID = vk_reflex_current_present_id()
|
||||
};
|
||||
VkSubmitInfo2 si = {.sType = VK_STRUCTURE_TYPE_SUBMIT_INFO_2,
|
||||
.pNext = (c->has_nv_reflex) ? &lsid : NULL,
|
||||
.commandBufferInfoCount = (pro ? 1u : 0u) + (recorded ? 1u : 0u),
|
||||
.pCommandBufferInfos = pro ? cbi : cbi + 1, .signalSemaphoreInfoCount = 1,
|
||||
.pSignalSemaphoreInfos = &sig};
|
||||
ts_submitted();
|
||||
if (recorded && c->has_nv_reflex) vk_reflex_marker(2); // VK_LATENCY_MARKER_RENDERSUBMIT_START_NV
|
||||
VkResult r = rec_submit(&si); // by the recorder when it recorded the part
|
||||
if (recorded && c->has_nv_reflex) vk_reflex_marker(3); // VK_LATENCY_MARKER_RENDERSUBMIT_END_NV
|
||||
if (r != VK_SUCCESS) {
|
||||
vk_device_fault_report(r);
|
||||
rt_fatal("vk: vkQueueSubmit2 of value %llu failed (%d)", (unsigned long long)fence, (int)r);
|
||||
|
||||
Reference in new issue
Block a user