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