Member naming
This commit is contained in:
parent
00f080c046
commit
ef96b3c3e3
2 changed files with 13 additions and 15 deletions
|
|
@ -599,11 +599,11 @@ void VulkanExampleBase::submitFrame()
|
||||||
// Wait for render complete semaphore
|
// Wait for render complete semaphore
|
||||||
submitInfo.waitSemaphoreCount = 1;
|
submitInfo.waitSemaphoreCount = 1;
|
||||||
submitInfo.pWaitSemaphores = &semaphores.renderComplete;
|
submitInfo.pWaitSemaphores = &semaphores.renderComplete;
|
||||||
// Signal ready with text overlay complete semaphpre
|
// Signal ready with UI overlay complete semaphpre
|
||||||
submitInfo.signalSemaphoreCount = 1;
|
submitInfo.signalSemaphoreCount = 1;
|
||||||
submitInfo.pSignalSemaphores = &semaphores.textOverlayComplete;
|
submitInfo.pSignalSemaphores = &semaphores.overlayComplete;
|
||||||
|
|
||||||
// Submit current text overlay command buffer
|
// Submit current UI overlay command buffer
|
||||||
submitInfo.commandBufferCount = 1;
|
submitInfo.commandBufferCount = 1;
|
||||||
submitInfo.pCommandBuffers = &UIOverlay->cmdBuffers[currentBuffer];
|
submitInfo.pCommandBuffers = &UIOverlay->cmdBuffers[currentBuffer];
|
||||||
VK_CHECK_RESULT(vkQueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE));
|
VK_CHECK_RESULT(vkQueueSubmit(queue, 1, &submitInfo, VK_NULL_HANDLE));
|
||||||
|
|
@ -619,7 +619,7 @@ void VulkanExampleBase::submitFrame()
|
||||||
submitInfo.pSignalSemaphores = &semaphores.renderComplete;
|
submitInfo.pSignalSemaphores = &semaphores.renderComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
VK_CHECK_RESULT(swapChain.queuePresent(queue, currentBuffer, submitOverlay ? semaphores.textOverlayComplete : semaphores.renderComplete));
|
VK_CHECK_RESULT(swapChain.queuePresent(queue, currentBuffer, submitOverlay ? semaphores.overlayComplete : semaphores.renderComplete));
|
||||||
|
|
||||||
VK_CHECK_RESULT(vkQueueWaitIdle(queue));
|
VK_CHECK_RESULT(vkQueueWaitIdle(queue));
|
||||||
}
|
}
|
||||||
|
|
@ -731,7 +731,7 @@ VulkanExampleBase::~VulkanExampleBase()
|
||||||
|
|
||||||
vkDestroySemaphore(device, semaphores.presentComplete, nullptr);
|
vkDestroySemaphore(device, semaphores.presentComplete, nullptr);
|
||||||
vkDestroySemaphore(device, semaphores.renderComplete, nullptr);
|
vkDestroySemaphore(device, semaphores.renderComplete, nullptr);
|
||||||
vkDestroySemaphore(device, semaphores.textOverlayComplete, nullptr);
|
vkDestroySemaphore(device, semaphores.overlayComplete, nullptr);
|
||||||
|
|
||||||
if (UIOverlay) {
|
if (UIOverlay) {
|
||||||
delete UIOverlay;
|
delete UIOverlay;
|
||||||
|
|
@ -898,9 +898,9 @@ void VulkanExampleBase::initVulkan()
|
||||||
// Ensures that the image is not presented until all commands have been sumbitted and executed
|
// Ensures that the image is not presented until all commands have been sumbitted and executed
|
||||||
VK_CHECK_RESULT(vkCreateSemaphore(device, &semaphoreCreateInfo, nullptr, &semaphores.renderComplete));
|
VK_CHECK_RESULT(vkCreateSemaphore(device, &semaphoreCreateInfo, nullptr, &semaphores.renderComplete));
|
||||||
// Create a semaphore used to synchronize command submission
|
// Create a semaphore used to synchronize command submission
|
||||||
// Ensures that the image is not presented until all commands for the text overlay have been sumbitted and executed
|
// Ensures that the image is not presented until all commands for the UI overlay have been sumbitted and executed
|
||||||
// Will be inserted after the render complete semaphore if the text overlay is enabled
|
// Will be inserted after the render complete semaphore if the UI overlay is enabled
|
||||||
VK_CHECK_RESULT(vkCreateSemaphore(device, &semaphoreCreateInfo, nullptr, &semaphores.textOverlayComplete));
|
VK_CHECK_RESULT(vkCreateSemaphore(device, &semaphoreCreateInfo, nullptr, &semaphores.overlayComplete));
|
||||||
|
|
||||||
// Set up submit info structure
|
// Set up submit info structure
|
||||||
// Semaphores will stay the same during application lifetime
|
// Semaphores will stay the same during application lifetime
|
||||||
|
|
@ -1545,7 +1545,7 @@ void VulkanExampleBase::keyboardKey(struct wl_keyboard *keyboard,
|
||||||
break;
|
break;
|
||||||
case KEY_F1:
|
case KEY_F1:
|
||||||
if (state && settings.overlay)
|
if (state && settings.overlay)
|
||||||
textOverlay->visible = !textOverlay->visible;
|
settings.overlay = !settings.overlay;
|
||||||
break;
|
break;
|
||||||
case KEY_ESC:
|
case KEY_ESC:
|
||||||
quit = true;
|
quit = true;
|
||||||
|
|
@ -1858,9 +1858,8 @@ void VulkanExampleBase::handleEvent(const xcb_generic_event_t *event)
|
||||||
paused = !paused;
|
paused = !paused;
|
||||||
break;
|
break;
|
||||||
case KEY_F1:
|
case KEY_F1:
|
||||||
if (settings.overlay)
|
if (settings.overlay) {
|
||||||
{
|
settings.overlay = !settings.overlay;
|
||||||
textOverlay->visible = !textOverlay->visible;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -126,8 +126,8 @@ protected:
|
||||||
VkSemaphore presentComplete;
|
VkSemaphore presentComplete;
|
||||||
// Command buffer submission and execution
|
// Command buffer submission and execution
|
||||||
VkSemaphore renderComplete;
|
VkSemaphore renderComplete;
|
||||||
// Text overlay submission and execution
|
// UI overlay submission and execution
|
||||||
VkSemaphore textOverlayComplete;
|
VkSemaphore overlayComplete;
|
||||||
} semaphores;
|
} semaphores;
|
||||||
public:
|
public:
|
||||||
bool prepared = false;
|
bool prepared = false;
|
||||||
|
|
@ -389,7 +389,6 @@ public:
|
||||||
void prepareFrame();
|
void prepareFrame();
|
||||||
|
|
||||||
// Submit the frames' workload
|
// Submit the frames' workload
|
||||||
// - Submits the text overlay (if enabled)
|
|
||||||
void submitFrame();
|
void submitFrame();
|
||||||
|
|
||||||
/** @brief (Virtual) Called when the UI overlay is updating, can be used to add custom elements to the overlay */
|
/** @brief (Virtual) Called when the UI overlay is updating, can be used to add custom elements to the overlay */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue