Added pick device support
This commit is contained in:
@@ -4,16 +4,35 @@
|
||||
|
||||
namespace PB::Renderer
|
||||
{
|
||||
struct QueueFamilyIndices
|
||||
{
|
||||
std::optional<uint32_t> graphicsFamily = std::nullopt;
|
||||
std::optional<uint32_t> presentFamily = std::nullopt;
|
||||
|
||||
[[nodiscard]] bool Complete() const
|
||||
{
|
||||
return graphicsFamily && presentFamily;
|
||||
}
|
||||
};
|
||||
|
||||
class VulkanManager
|
||||
{
|
||||
private:
|
||||
static std::optional<VkInstance> s_Instance;
|
||||
static std::optional<VkSurfaceKHR> s_Surface;
|
||||
|
||||
public:
|
||||
static std::optional<VkInstance> Init();
|
||||
static bool Cleanup();
|
||||
|
||||
static std::optional<VkSurfaceKHR> CreateSurface(GLFWwindow* window);
|
||||
static bool PickPhysicalDevice();
|
||||
|
||||
private:
|
||||
static bool IsDeviceSuitable(VkPhysicalDevice device, VkSurfaceKHR surface);
|
||||
static QueueFamilyIndices FindQueueFamilies(VkPhysicalDevice device, VkSurfaceKHR surface);
|
||||
static bool CheckDeviceExtensionSupport(VkPhysicalDevice device);
|
||||
|
||||
static std::optional<VkInstance> s_Instance;
|
||||
static std::optional<VkSurfaceKHR> s_Surface;
|
||||
|
||||
static VkPhysicalDevice s_PhysicalDevice;
|
||||
static QueueFamilyIndices s_QueueIndices;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user