2020-03-24 21:05:32 +01:00
|
|
|
#pragma once
|
2020-03-02 19:07:49 +01:00
|
|
|
#include "Graphics/Graphics.h"
|
2020-03-13 12:44:33 +01:00
|
|
|
#include "VulkanGraphicsResources.h"
|
2020-03-02 19:07:49 +01:00
|
|
|
|
|
|
|
|
namespace Seele
|
|
|
|
|
{
|
2020-03-20 01:27:40 +01:00
|
|
|
namespace Vulkan
|
2020-03-02 19:07:49 +01:00
|
|
|
{
|
2020-03-20 01:27:40 +01:00
|
|
|
DECLARE_REF(Allocator);
|
2020-03-24 21:05:32 +01:00
|
|
|
DECLARE_REF(CommandBufferManager);
|
|
|
|
|
DECLARE_REF(Queue);
|
2020-03-20 01:27:40 +01:00
|
|
|
class Graphics : public Gfx::Graphics
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
Graphics();
|
|
|
|
|
virtual ~Graphics();
|
|
|
|
|
VkDevice getDevice() const;
|
|
|
|
|
VkPhysicalDevice getPhysicalDevice() const;
|
2020-03-09 12:30:07 +01:00
|
|
|
|
2020-03-24 21:05:32 +01:00
|
|
|
PCommandBufferManager getGraphicsCommands();
|
|
|
|
|
PCommandBufferManager getComputeCommands();
|
|
|
|
|
PCommandBufferManager getTransferCommands();
|
|
|
|
|
PCommandBufferManager getDedicatedTransferCommands();
|
|
|
|
|
|
2020-03-20 01:27:40 +01:00
|
|
|
// Inherited via Graphics
|
|
|
|
|
virtual void init(GraphicsInitializer initializer) override;
|
|
|
|
|
virtual void beginFrame(void* windowHandle) override;
|
|
|
|
|
virtual void endFrame(void* windowHandle) override;
|
|
|
|
|
virtual void* createWindow(const WindowCreateInfo& createInfo) override;
|
|
|
|
|
protected:
|
|
|
|
|
Array<const char*> getRequiredExtensions();
|
|
|
|
|
void initInstance(GraphicsInitializer initInfo);
|
|
|
|
|
void setupDebugCallback();
|
|
|
|
|
void pickPhysicalDevice();
|
2020-03-24 21:05:32 +01:00
|
|
|
void createDevice(GraphicsInitializer initInfo);
|
2020-03-13 12:44:33 +01:00
|
|
|
|
2020-03-20 01:27:40 +01:00
|
|
|
VkDevice handle;
|
|
|
|
|
VkPhysicalDevice physicalDevice;
|
|
|
|
|
VkInstance instance;
|
2020-03-24 21:05:32 +01:00
|
|
|
|
|
|
|
|
WQueue graphicsQueue;
|
|
|
|
|
WQueue computeQueue;
|
|
|
|
|
WQueue transferQueue;
|
|
|
|
|
WQueue dedicatedTransferQueue;
|
|
|
|
|
QueueFamilyMapping queueMapping;
|
|
|
|
|
PCommandBufferManager graphicsCommands;
|
|
|
|
|
PCommandBufferManager computeCommands;
|
|
|
|
|
PCommandBufferManager transferCommands;
|
|
|
|
|
PCommandBufferManager dedicatedTransferCommands;
|
|
|
|
|
VkPhysicalDeviceProperties props;
|
|
|
|
|
VkPhysicalDeviceFeatures features;
|
2020-03-20 01:27:40 +01:00
|
|
|
VkDebugReportCallbackEXT callback;
|
|
|
|
|
Array<PViewport> viewports;
|
|
|
|
|
PAllocator allocator;
|
2020-03-24 21:05:32 +01:00
|
|
|
|
2020-03-20 01:27:40 +01:00
|
|
|
friend class Window;
|
|
|
|
|
};
|
|
|
|
|
DEFINE_REF(Graphics);
|
|
|
|
|
}
|
2020-03-02 19:07:49 +01:00
|
|
|
}
|