3#include "../IGraphicsDevice.h"
5#include "../Base/SyncObjectsCommon.h"
12#include "TexturesVK.h"
13#include "RenderTargetsVK.h"
14#include "CapabilitiesVK.h"
27 bool initializeInstance();
28 bool initializeDevice();
29 bool initializeSwapChain();
30 bool initializeCommandPool();
32 bool initializeDepth();
36 bool initializeFramebuffers();
38 bool getMemoryType(uint32_t typeBits, VkFlags requirements_mask, uint32_t *typeIndex);
43 void setSize(
int width,
int height)
override;
44 bool getSize(
int& width,
int& height)
const override;
50 void * getNativeDevice()
override {
return device; }
62 VkCommandBuffer getCommandBuffer();
72 RenderTargetsVK renderTargets;
73 CapabilitiesVK capabilities;
74 SyncObjectsCommon syncObjects;
76 VkInstance instance = VK_NULL_HANDLE;
77 VkPhysicalDevice physicalDevice = VK_NULL_HANDLE;
78 VkDevice device = VK_NULL_HANDLE;
79 VkQueue queue = VK_NULL_HANDLE;
81 VkPhysicalDeviceFeatures physicalDeviceFeatures;
83 VkSurfaceKHR surface = VK_NULL_HANDLE;
84 VkSwapchainKHR swapChain = VK_NULL_HANDLE;
86 VkCommandPool commandPool = VK_NULL_HANDLE;
87 VkCommandBuffer setupCommands = VK_NULL_HANDLE;
89 std::vector<VkImage> swapChainImages;
91 std::vector<RenderTargetHandle> framebuffers;
92 std::vector<TextureHandle> backBuffers;
93 std::vector<TextureHandle> backBuffersMS;
95 TextureHandle depthTextureHandle;
97 VkPhysicalDeviceMemoryProperties memoryProperties;
99 uint32_t currentFrameBuffer = 0;
101 VkSemaphore presentCompleteSemaphore = VK_NULL_HANDLE;
105 bool needsResize =
true;
ITextures * getTextures() override
Get a pointer to the texture management interface.
void releaseResources() override
Release all resources allocated.
bool initialize() override
Initializes the graphics device with the settings previous set through calling setSettings.
bool getSize(int &width, int &height) const override
Retrieve the size previously set by setSize.
void beginFrame() override
Signal the beginning of a new frame to the graphics device.
GraphicsDeviceType getType() const override
Get the type of the graphics device.
IBuffers * getBuffers() override
Get a pointer to the buffer management interface.
IContext * getImmediateContext() override
Get a pointer to the immediate context used to issue commands to the graphics device.
void waitForCommandSync() override
Wait for any GPU commands on the current device to finish before returning.
std::string getIdentifier() const override
Get the graphics device identifier.
void setSize(int width, int height) override
Set the size of the main drawing buffer used by the graphics device in pixels.
IPipelineStates * getPipelineStates()
Get a pointer to the pipeline state management interface.
void endFrame(uint32_t syncInterval=0, uint32_t presentFlags=PresentFlags::None) override
Signal the end of a frame to the graphics device.
IEffects * getEffects() override
Get a pointer to the effect management interface.
ICapabilities * getCapabilities()
Get a pointer to the capability management interface used to query the graphics device capability fla...
ISwapChain * getDefaultSwapChain() override
Get a pointer to the default swap chain for this graphics device.
IRenderTargets * getRenderTargets()
Get a pointer to the render target management interface.
ISyncObjects * getSyncObjects() override
Get a pointer to the sync object management interface.
Represents a graphics device used to manage graphics resources and issue drawing commands.
Contains all Cogs related functionality.
GraphicsDeviceType
Contains types of graphics devices that may be supported.
@ Vulkan
Graphics device using the Vulkan API.
Settings for graphics device initialization.
Provides buffer management functionality.
Provides capability query functionality.
Represents a graphics device context which can receive rendering commands.
Provides effects and shader management functionality.
Provides render target management functionality.
Provides sync object management.
Provides texture management functionality.