Копия проекта с репозитория 02
This commit is contained in:
19
include/PhysicalDevice.h
Normal file
19
include/PhysicalDevice.h
Normal file
@@ -0,0 +1,19 @@
|
||||
#ifndef PHYSICALDEVICE_H
|
||||
#define PHYSICALDEVICE_H
|
||||
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include <vector>
|
||||
|
||||
typedef struct _PhysicalDevice
|
||||
{
|
||||
VkPhysicalDevice device; // устройство
|
||||
VkPhysicalDeviceProperties properties; // параметры
|
||||
VkPhysicalDeviceFeatures features; // функции
|
||||
VkPhysicalDeviceMemoryProperties memory; // память
|
||||
std::vector<VkQueueFamilyProperties> queueFamilyProperties; // семейства очередей
|
||||
|
||||
uint32_t pickQueueFamily(VkQueueFlags);
|
||||
} PhysicalDevice;
|
||||
|
||||
#endif // PHYSICALDEVICE_H
|
||||
31
include/vk.h
Normal file
31
include/vk.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#ifndef VK_H
|
||||
#define VK_H
|
||||
|
||||
#include <vulkan/vulkan.h>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
#include "PhysicalDevice.h"
|
||||
|
||||
class Vulkan
|
||||
{
|
||||
public:
|
||||
void init(); // инициализация
|
||||
void destroy(); // завершение работы
|
||||
private:
|
||||
VkInstance instance; // Экземпляр Vulkan
|
||||
PhysicalDevice physicalDevice; // Физическое устройство
|
||||
VkDevice logicalDevice; // логическое устройство
|
||||
VkQueue graphicalQueue; // очередь для работы с графикой
|
||||
// Структура для хранения флагов
|
||||
struct
|
||||
{
|
||||
const bool VALIDATION = true; // Использование слоев проверки
|
||||
} states;
|
||||
|
||||
|
||||
void createInstance(); // Создание экземпяра Vulkan
|
||||
void selectPhysicalDevice(std::vector<const char*> &deviceExtensions); // Выбор физического устройства
|
||||
void createLogicalDevice(std::vector<const char*> &deviceExtensions); // Создание логического устройства
|
||||
};
|
||||
|
||||
#endif // VK_H
|
||||
Reference in New Issue
Block a user