Implement quick shader switch hotkeys

This commit is contained in:
Dynamitos
2024-05-23 14:58:14 +02:00
parent 8399b176bb
commit e0961bce24
20 changed files with 160 additions and 110 deletions
+1 -1
View File
@@ -388,7 +388,7 @@ void PipelineLayout::create() {
std::unique_lock l(layoutLock);
if (cachedLayouts.contains(layoutHash)) {
std::cout << "New Layout" << std::endl;
// std::cout << "New Layout" << std::endl;
layoutHandle = cachedLayouts[layoutHash];
return;
}
+2 -1
View File
@@ -69,7 +69,8 @@ void Fence::reset()
{
if (signaled)
{
vkResetFences(graphics->getDevice(), 1, &fence);
VK_CHECK(vkResetFences(graphics->getDevice(), 1, &fence));
//std::cout << vkGetFenceStatus(graphics->getDevice(), fence) << std::endl;
signaled = false;
}
}
+3 -3
View File
@@ -114,7 +114,7 @@ void Window::pollInput()
void Window::beginFrame()
{
imageAvailableFences[currentSemaphoreIndex]->wait(100000);
imageAvailableFences[currentSemaphoreIndex]->wait(100000000);
imageAvailableFences[currentSemaphoreIndex]->reset();
vkAcquireNextImageKHR(graphics->getDevice(), swapchain, std::numeric_limits<uint64>::max(), imageAvailableSemaphores[currentSemaphoreIndex]->getHandle(), imageAvailableFences[currentSemaphoreIndex]->getHandle(), &currentImageIndex);
graphics->getGraphicsCommands()->getCommands()->waitForSemaphore(VK_PIPELINE_STAGE_COLOR_ATTACHMENT_OUTPUT_BIT, imageAvailableSemaphores[currentSemaphoreIndex]);
@@ -284,14 +284,14 @@ void Window::chooseSwapSurfaceFormat()
void Window::chooseSwapPresentMode()
{
/*for (const auto& supportedPresentMode : supportedPresentModes)
for (const auto& supportedPresentMode : supportedPresentModes)
{
if (supportedPresentMode == VK_PRESENT_MODE_MAILBOX_KHR)
{
presentMode = supportedPresentMode;
return;
}
}*/
}
presentMode = VK_PRESENT_MODE_FIFO_KHR;
}