Removed uneeded std::optional uses
This commit is contained in:
@@ -6,12 +6,16 @@ namespace PB::Renderer
|
||||
{
|
||||
struct QueueFamilyIndices
|
||||
{
|
||||
std::optional<uint32_t> graphicsFamily = std::nullopt;
|
||||
std::optional<uint32_t> presentFamily = std::nullopt;
|
||||
static constexpr uint32_t UNDEFINED_UINT32_VALUE = 0xFFFFFFFF;
|
||||
|
||||
uint32_t graphicsFamily = UNDEFINED_UINT32_VALUE;
|
||||
uint32_t presentFamily = UNDEFINED_UINT32_VALUE;
|
||||
|
||||
[[nodiscard]] bool Complete() const
|
||||
{
|
||||
return graphicsFamily && presentFamily;
|
||||
return
|
||||
graphicsFamily != UNDEFINED_UINT32_VALUE &&
|
||||
presentFamily != UNDEFINED_UINT32_VALUE;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -25,14 +29,15 @@ namespace PB::Renderer
|
||||
class VulkanManager
|
||||
{
|
||||
public:
|
||||
/* Static class so (de)constructors have been deleted to stop accidental creation */
|
||||
VulkanManager() = delete;
|
||||
~VulkanManager() = delete;
|
||||
|
||||
static bool InitAll(GLFWwindow* window);
|
||||
static std::optional<VkInstance> Init();
|
||||
static bool Init(GLFWwindow* window);
|
||||
static bool Cleanup();
|
||||
|
||||
static std::optional<VkSurfaceKHR> CreateSurface(GLFWwindow* window);
|
||||
static bool CreateInstance();
|
||||
static bool CreateSurface(GLFWwindow* window);
|
||||
static bool PickPhysicalDevice();
|
||||
static bool CreateLogicalDevice();
|
||||
static bool CreateSwapChain(GLFWwindow* window);
|
||||
@@ -41,7 +46,7 @@ namespace PB::Renderer
|
||||
static bool CreateFramebuffer();
|
||||
static bool CreateGraphicsPipeline();
|
||||
static bool CreateCommandBuffers();
|
||||
static void CreateSemaphores();
|
||||
static bool CreateSemaphores();
|
||||
|
||||
static bool RenderPass();
|
||||
|
||||
@@ -57,8 +62,8 @@ namespace PB::Renderer
|
||||
|
||||
static VkShaderModule CreateShaderModule(const std::string& filename);
|
||||
|
||||
static std::optional<VkInstance> s_Instance;
|
||||
static std::optional<VkSurfaceKHR> s_Surface;
|
||||
static VkInstance s_Instance;
|
||||
static VkSurfaceKHR s_Surface;
|
||||
|
||||
static VkPhysicalDevice s_PhysicalDevice;
|
||||
static QueueFamilyIndices s_QueueIndices;
|
||||
|
||||
Reference in New Issue
Block a user