Skip to content

Commit

Permalink
Only enable the validation layers in debug build.
Browse files Browse the repository at this point in the history
  • Loading branch information
GPSnoopy committed Apr 11, 2019
1 parent 17ddc30 commit 6465405
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/RayTracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,18 @@
#include "Vulkan/Window.hpp"
#include <iostream>

namespace
{
const bool EnableValidationLayers =
#ifdef NDEBUG
false;
#else
true;
#endif
}

RayTracer::RayTracer(const UserSettings& userSettings, const Vulkan::WindowConfig& windowConfig, const bool vsync) :
Application(windowConfig, vsync, !userSettings.Benchmark),
Application(windowConfig, vsync, EnableValidationLayers),
userSettings_(userSettings)
{
}
Expand Down
2 changes: 1 addition & 1 deletion src/RayTracer.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,5 +54,5 @@ class RayTracer final : public Vulkan::RayTracing::Application

// Benchmark stats
double initialTime_{};
uint32_t totalFrames_;
uint32_t totalFrames_{};
};

0 comments on commit 6465405

Please sign in to comment.