42 lines
1.0 KiB
C
42 lines
1.0 KiB
C
// =============================================
|
|
// Aster: device.h
|
|
// Copyright (c) 2020-2024 Anish Bhobe
|
|
// =============================================
|
|
|
|
#pragma once
|
|
|
|
#include "global.h"
|
|
|
|
#include <EASTL/vector.h>
|
|
|
|
struct Context;
|
|
struct PhysicalDevice;
|
|
|
|
struct QueueAllocation
|
|
{
|
|
u32 m_Family;
|
|
u32 m_Count;
|
|
};
|
|
|
|
struct Features
|
|
{
|
|
vk::PhysicalDeviceFeatures m_Vulkan10Features;
|
|
vk::PhysicalDeviceVulkan11Features m_Vulkan11Features;
|
|
vk::PhysicalDeviceVulkan12Features m_Vulkan12Features;
|
|
vk::PhysicalDeviceVulkan13Features m_Vulkan13Features;
|
|
};
|
|
|
|
struct Device final
|
|
{
|
|
NameString m_Name;
|
|
vk::PhysicalDevice m_PhysicalDevice = nullptr;
|
|
vk::Device m_Device = nullptr;
|
|
VmaAllocator m_Allocator = nullptr;
|
|
|
|
Device(const Context *context, PhysicalDevice *physicalDevice, Features *enabledFeatures,
|
|
const eastl::vector<QueueAllocation> &queueAllocations, NameString &&name);
|
|
~Device();
|
|
|
|
[[nodiscard]] vk::Queue GetQueue(u32 familyIndex, u32 queueIndex) const;
|
|
};
|