28 lines
740 B
C++
28 lines
740 B
C++
// =============================================
|
|
// Aster: device.h
|
|
// Copyright (c) 2020-2024 Anish Bhobe
|
|
// =============================================
|
|
|
|
#pragma once
|
|
|
|
#include "global.h"
|
|
#include "physical_device.h"
|
|
|
|
constexpr std::string DEFAULT_DEVICE_NAME = "<Unnamed GPU>";
|
|
|
|
struct QueueAllocation {
|
|
u32 family;
|
|
u32 count;
|
|
};
|
|
|
|
struct Device final {
|
|
vk::Device device;
|
|
PhysicalDevice physical_device;
|
|
VmaAllocator allocator { nullptr };
|
|
std::optional<std::string> name { nullptr };
|
|
|
|
Device(const Context *_context, PhysicalDevice &&_physical_device, const vk::PhysicalDeviceFeatures *_enabled_features, const std::vector<QueueAllocation> &_queue_allocation, std::optional<std::string> _name = std::nullopt);
|
|
|
|
~Device();
|
|
};
|