Use debug marker flag from vulkanDevice class, fixed fps display (sync with actual frame time)

This commit is contained in:
saschawillems 2016-08-30 21:53:15 +02:00
parent ffeabc7570
commit b7ca1aad5d
2 changed files with 3 additions and 5 deletions

View file

@ -197,7 +197,7 @@ void VulkanExampleBase::createPipelineCache()
void VulkanExampleBase::prepare()
{
if (enableDebugMarkers)
if (vulkanDevice->enableDebugMarkers)
{
vkDebug::DebugMarker::setup(device);
}
@ -404,7 +404,7 @@ void VulkanExampleBase::renderLoop()
std::string windowTitle = getWindowTitle();
SetWindowText(window, windowTitle.c_str());
}
lastFPS = frameCounter;
lastFPS = roundf(1.0f / frameTimer);
updateTextOverlay();
fpsTimer = 0.0f;
frameCounter = 0;
@ -575,7 +575,7 @@ void VulkanExampleBase::updateTextOverlay()
textOverlay->addText(title, 5.0f, 5.0f, VulkanTextOverlay::alignLeft);
std::stringstream ss;
ss << std::fixed << std::setprecision(2) << (frameTimer * 1000.0f) << "ms (" << lastFPS << " fps)";
ss << std::fixed << std::setprecision(3) << (frameTimer * 1000.0f) << "ms (" << lastFPS << " fps)";
textOverlay->addText(ss.str(), 5.0f, 25.0f, VulkanTextOverlay::alignLeft);
textOverlay->addText(deviceProperties.deviceName, 5.0f, 45.0f, VulkanTextOverlay::alignLeft);

View file

@ -52,8 +52,6 @@ class VulkanExampleBase
private:
// Set to true when example is created with enabled validation layers
bool enableValidation = false;
// Set to true when the debug marker extension is detected
bool enableDebugMarkers = false;
// Set to true if v-sync will be forced for the swapchain
bool enableVSync = false;
// Device features enabled by the example