-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathValidationLayers.hpp
35 lines (26 loc) · 1.17 KB
/
ValidationLayers.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#pragma once
#include "RendererCommon.h"
class ValidationLayers {
public:
ValidationLayers() = default;
~ValidationLayers() = default;
void setupDebugMessenger(VkInstance instance);
bool checkValidationLayerSupport();
std::vector<const char*> getRequiredExtensions();
void populateDebugMessengerCreateInfo(VkDebugUtilsMessengerCreateInfoEXT& createInfo);
const VkDebugUtilsMessengerEXT& getDebugMessenger();
const std::vector<const char*>& getValidationLayers();
private:
static VKAPI_ATTR VkBool32 VKAPI_CALL debugCallback(VkDebugUtilsMessageSeverityFlagBitsEXT messageSeverity,
VkDebugUtilsMessageTypeFlagsEXT messageType,
const VkDebugUtilsMessengerCallbackDataEXT* pCallbackData,
void* pUserData);
VkDebugUtilsMessengerEXT debugMessenger;
const std::vector<const char*> validationLayers = {
"VK_LAYER_KHRONOS_validation"
};
};
VkResult CreateDebugUtilsMessengerEXT(VkInstance instance, const VkDebugUtilsMessengerCreateInfoEXT* pCreateInfo,
const VkAllocationCallbacks* pAllocator, VkDebugUtilsMessengerEXT* pDebugMessenger);
void DestroyDebugUtilsMessengerEXT(VkInstance instance, VkDebugUtilsMessengerEXT debugMessneger,
const VkAllocationCallbacks* pAllocator);