Removed layer hard-coding.
This commit is contained in:
parent
86326a4fa1
commit
ec1fc0570d
|
|
@ -3,3 +3,4 @@
|
|||
build/
|
||||
.vs/
|
||||
.direnv/
|
||||
.ccls-cache/
|
||||
|
|
|
|||
|
|
@ -7,10 +7,6 @@
|
|||
#include <EASTL/array.h>
|
||||
#include <EASTL/fixed_vector.h>
|
||||
|
||||
constexpr eastl::array VALIDATION_LAYERS = {
|
||||
"VK_LAYER_KHRONOS_validation",
|
||||
};
|
||||
|
||||
VKAPI_ATTR b32 VKAPI_CALL
|
||||
DebugCallback(const VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
|
||||
const VkDebugUtilsMessageTypeFlagsEXT messageType,
|
||||
|
|
@ -80,8 +76,6 @@ Context::Context(const cstr appName, const Version version, bool enableValidatio
|
|||
const auto instanceCreateInfo = vk::InstanceCreateInfo{
|
||||
.pNext = enableValidation ? &debugUtilsMessengerCreateInfo : nullptr,
|
||||
.pApplicationInfo = &appInfo,
|
||||
.enabledLayerCount = enableValidation ? Cast<u32>(VALIDATION_LAYERS.size()) : 0,
|
||||
.ppEnabledLayerNames = enableValidation ? VALIDATION_LAYERS.data() : nullptr,
|
||||
.enabledExtensionCount = Cast<u32>(instanceExtensions.size()),
|
||||
.ppEnabledExtensionNames = instanceExtensions.data(),
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ struct Context final
|
|||
vk::DebugUtilsMessengerEXT m_DebugMessenger = nullptr;
|
||||
|
||||
// Ctor/Dtor
|
||||
Context(cstr appName, Version version, bool enableValidation = ENABLE_VALIDATION_DEFAULT_VALUE);
|
||||
Context(cstr appName, Version version, bool enableValidation = ENABLE_LAYER_MESSAGES_DEFAULT_VALUE);
|
||||
~Context();
|
||||
|
||||
// Move
|
||||
|
|
@ -29,9 +29,9 @@ struct Context final
|
|||
Context &operator=(Context &&other) noexcept;
|
||||
|
||||
#if !defined(ASTER_NDEBUG)
|
||||
constexpr static bool ENABLE_VALIDATION_DEFAULT_VALUE = true;
|
||||
constexpr static bool ENABLE_LAYER_MESSAGES_DEFAULT_VALUE = true;
|
||||
#else
|
||||
constexpr static bool ENABLE_VALIDATION_DEFAULT_VALUE = false;
|
||||
constexpr static bool ENABLE_LAYER_MESSAGES_DEFAULT_VALUE = false;
|
||||
#endif
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(Context);
|
||||
|
|
|
|||
Loading…
Reference in New Issue