mirror of
https://github.com/PancakeTAS/lsfg-vk.git
synced 2025-10-30 07:01:10 +00:00
allow hot-reloading disable/enable if enabled at start
This commit is contained in:
parent
f60f2cf313
commit
0401f72452
1 changed files with 7 additions and 3 deletions
|
|
@ -247,15 +247,19 @@ namespace {
|
||||||
// NOLINTEND | present the next frame
|
// NOLINTEND | present the next frame
|
||||||
VkResult res{}; // might return VK_SUBOPTIMAL_KHR
|
VkResult res{}; // might return VK_SUBOPTIMAL_KHR
|
||||||
try {
|
try {
|
||||||
std::vector<VkSemaphore> semaphores(pPresentInfo->waitSemaphoreCount);
|
|
||||||
std::copy_n(pPresentInfo->pWaitSemaphores, semaphores.size(), semaphores.data());
|
|
||||||
|
|
||||||
// ensure config is valid
|
// ensure config is valid
|
||||||
auto& conf = Config::activeConf;
|
auto& conf = Config::activeConf;
|
||||||
if (!conf.valid->load(std::memory_order_relaxed))
|
if (!conf.valid->load(std::memory_order_relaxed))
|
||||||
return VK_ERROR_OUT_OF_DATE_KHR;
|
return VK_ERROR_OUT_OF_DATE_KHR;
|
||||||
|
|
||||||
|
// skip if disabled
|
||||||
|
if (!conf.enable)
|
||||||
|
return Layer::ovkQueuePresentKHR(queue, pPresentInfo);
|
||||||
|
|
||||||
// present the swapchain
|
// present the swapchain
|
||||||
|
std::vector<VkSemaphore> semaphores(pPresentInfo->waitSemaphoreCount);
|
||||||
|
std::copy_n(pPresentInfo->pWaitSemaphores, semaphores.size(), semaphores.data());
|
||||||
|
|
||||||
res = swapchain.present(deviceInfo, pPresentInfo->pNext,
|
res = swapchain.present(deviceInfo, pPresentInfo->pNext,
|
||||||
queue, semaphores, *pPresentInfo->pImageIndices);
|
queue, semaphores, *pPresentInfo->pImageIndices);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue