implementing renderpass and vieport
This commit is contained in:
@@ -1,62 +1,83 @@
|
||||
#pragma once
|
||||
#include "Graphics/Graphics.h"
|
||||
#include "VulkanGraphicsResources.h"
|
||||
#include "Graphics/Graphics.h"
|
||||
|
||||
namespace Seele
|
||||
{
|
||||
namespace Vulkan
|
||||
namespace Vulkan
|
||||
{
|
||||
DECLARE_REF(Allocator);
|
||||
DECLARE_REF(StagingManager);
|
||||
DECLARE_REF(CommandBufferManager);
|
||||
DECLARE_REF(Queue);
|
||||
DECLARE_REF(Framebuffer);
|
||||
class Graphics : public Gfx::Graphics
|
||||
{
|
||||
public:
|
||||
Graphics();
|
||||
virtual ~Graphics();
|
||||
VkInstance getInstance() const;
|
||||
VkDevice getDevice() const;
|
||||
VkPhysicalDevice getPhysicalDevice() const;
|
||||
|
||||
PCommandBufferManager getGraphicsCommands();
|
||||
PCommandBufferManager getComputeCommands();
|
||||
PCommandBufferManager getTransferCommands();
|
||||
PCommandBufferManager getDedicatedTransferCommands();
|
||||
|
||||
const QueueFamilyMapping getFamilyMapping() const
|
||||
{
|
||||
DECLARE_REF(Allocator);
|
||||
DECLARE_REF(CommandBufferManager);
|
||||
DECLARE_REF(Queue);
|
||||
class Graphics : public Gfx::Graphics
|
||||
{
|
||||
public:
|
||||
Graphics();
|
||||
virtual ~Graphics();
|
||||
VkDevice getDevice() const;
|
||||
VkPhysicalDevice getPhysicalDevice() const;
|
||||
|
||||
PCommandBufferManager getGraphicsCommands();
|
||||
PCommandBufferManager getComputeCommands();
|
||||
PCommandBufferManager getTransferCommands();
|
||||
PCommandBufferManager getDedicatedTransferCommands();
|
||||
|
||||
PAllocator getAllocator();
|
||||
|
||||
// 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();
|
||||
void createDevice(GraphicsInitializer initInfo);
|
||||
|
||||
VkDevice handle;
|
||||
VkPhysicalDevice physicalDevice;
|
||||
VkInstance instance;
|
||||
|
||||
PQueue graphicsQueue;
|
||||
PQueue computeQueue;
|
||||
PQueue transferQueue;
|
||||
PQueue dedicatedTransferQueue;
|
||||
QueueFamilyMapping queueMapping;
|
||||
PCommandBufferManager graphicsCommands;
|
||||
PCommandBufferManager computeCommands;
|
||||
PCommandBufferManager transferCommands;
|
||||
PCommandBufferManager dedicatedTransferCommands;
|
||||
VkPhysicalDeviceProperties props;
|
||||
VkPhysicalDeviceFeatures features;
|
||||
VkDebugReportCallbackEXT callback;
|
||||
Array<PViewport> viewports;
|
||||
PAllocator allocator;
|
||||
|
||||
friend class Window;
|
||||
};
|
||||
DEFINE_REF(Graphics);
|
||||
return queueMapping;
|
||||
}
|
||||
}
|
||||
|
||||
PAllocator getAllocator();
|
||||
PStagingManager getStagingManager();
|
||||
|
||||
// Inherited via Graphics
|
||||
virtual void init(GraphicsInitializer initializer) override;
|
||||
virtual Gfx::PWindow createWindow(const WindowCreateInfo &createInfo) override;
|
||||
virtual Gfx::PViewport createViewport(Gfx::PWindow owner, const ViewportCreateInfo &createInfo) override;
|
||||
|
||||
virtual Gfx::PRenderPass createRenderPass(Gfx::PRenderTargetLayout layout) override;
|
||||
virtual void beginRenderPass(Gfx::PRenderPass renderPass) override;
|
||||
virtual void endRenderPass() override;
|
||||
|
||||
virtual Gfx::PTexture2D createTexture2D(const TextureCreateInfo &createInfo) override;
|
||||
virtual Gfx::PUniformBuffer createUniformBuffer(const BulkResourceData &bulkData) override;
|
||||
virtual Gfx::PStructuredBuffer createStructuredBuffer(const BulkResourceData &bulkData) override;
|
||||
virtual Gfx::PVertexBuffer createVertexBuffer(const BulkResourceData &bulkData) override;
|
||||
virtual Gfx::PIndexBuffer createIndexBuffer(const BulkResourceData &bulkData) override;
|
||||
|
||||
protected:
|
||||
Array<const char *> getRequiredExtensions();
|
||||
void initInstance(GraphicsInitializer initInfo);
|
||||
void setupDebugCallback();
|
||||
void pickPhysicalDevice();
|
||||
void createDevice(GraphicsInitializer initInfo);
|
||||
|
||||
VkDevice handle;
|
||||
VkPhysicalDevice physicalDevice;
|
||||
VkInstance instance;
|
||||
|
||||
PQueue graphicsQueue;
|
||||
PQueue computeQueue;
|
||||
PQueue transferQueue;
|
||||
PQueue dedicatedTransferQueue;
|
||||
QueueFamilyMapping queueMapping;
|
||||
PCommandBufferManager graphicsCommands;
|
||||
PCommandBufferManager computeCommands;
|
||||
PCommandBufferManager transferCommands;
|
||||
PCommandBufferManager dedicatedTransferCommands;
|
||||
VkPhysicalDeviceProperties props;
|
||||
VkPhysicalDeviceFeatures features;
|
||||
VkDebugReportCallbackEXT callback;
|
||||
Array<PViewport> viewports;
|
||||
Map<uint32, PFramebuffer> allocatedFramebuffers;
|
||||
PAllocator allocator;
|
||||
PStagingManager stagingManager;
|
||||
|
||||
friend class Window;
|
||||
};
|
||||
DEFINE_REF(Graphics);
|
||||
} // namespace Vulkan
|
||||
} // namespace Seele
|
||||
Reference in New Issue
Block a user