Cogs.Core
|
Public Member Functions | |
GraphicsDeviceVK (RenderingAllocatorInfo *allocator) | |
bool | initialize () override |
Initializes the graphics device with the settings previous set through calling setSettings. | |
bool | initializeInstance () |
bool | initializeDevice () |
bool | initializeSwapChain () |
bool | initializeCommandPool () |
bool | initializeDepth () |
void | flushSetup () |
bool | initializeFramebuffers () |
bool | getMemoryType (uint32_t typeBits, VkFlags requirements_mask, uint32_t *typeIndex) |
GraphicsDeviceType | getType () const override |
Get the type of the graphics device. | |
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. | |
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. | |
void | endFrame (uint32_t syncInterval=0, uint32_t presentFlags=PresentFlags::None) override |
Signal the end of a frame to the graphics device. | |
void | waitForCommandSync () override |
Wait for any GPU commands on the current device to finish before returning. | |
void | releaseResources () override |
Release all resources allocated. | |
void * | getNativeDevice () override |
IContext * | getImmediateContext () override |
Get a pointer to the immediate context used to issue commands to the graphics device. | |
IBuffers * | getBuffers () override |
Get a pointer to the buffer management interface. | |
ITextures * | getTextures () override |
Get a pointer to the texture management interface. | |
IRenderTargets * | getRenderTargets () |
Get a pointer to the render target management interface. | |
IEffects * | getEffects () override |
Get a pointer to the effect management interface. | |
IPipelineStates * | getPipelineStates () |
Get a pointer to the pipeline state management interface. | |
ICapabilities * | getCapabilities () |
Get a pointer to the capability management interface used to query the graphics device capability flags. | |
ISyncObjects * | getSyncObjects () override |
Get a pointer to the sync object management interface. | |
ISwapChain * | getDefaultSwapChain () override |
Get a pointer to the default swap chain for this graphics device. | |
VkCommandBuffer | getCommandBuffer () |
const GraphicsDeviceSettings & | getSettings () const |
void | resize () |
![]() | |
virtual | ~IGraphicsDevice ()=default |
Destructor. | |
virtual bool | initializeThread () |
Initialize the graphics device for operation on the current thread. | |
virtual SharedGraphicsContext * | createSharedContext () |
Create a shared graphics context that can be used to activate another thread for rendering. | |
virtual void | activateSharedContext (SharedGraphicsContext *) |
Activates the given shared context on the calling thread. | |
virtual void | releaseSharedContext (SharedGraphicsContext *) |
Releases the given shared context. | |
virtual bool | initialize ()=0 |
Initializes the graphics device with the settings previous set through calling setSettings. | |
virtual bool | isInitializationFinished () |
Check if async initialization is finished. | |
virtual ResourceStatistics | getResourceStatistics () |
virtual std::string | getIdentifier () const |
Get the graphics device identifier. | |
virtual GraphicsDeviceType | getType () const |
Get the type of the graphics device. | |
virtual void | setSize (int width, int height)=0 |
Set the size of the main drawing buffer used by the graphics device in pixels. | |
virtual bool | getSize (int &width, int &height) const =0 |
Retrieve the size previously set by setSize. | |
virtual void | beginFrame ()=0 |
Signal the beginning of a new frame to the graphics device. | |
virtual void | endFrame (uint32_t syncInterval=0, uint32_t presentFlags=PresentFlags::None)=0 |
Signal the end of a frame to the graphics device. | |
virtual void | waitForCommandSync () |
Wait for any GPU commands on the current device to finish before returning. | |
virtual void | releaseResources ()=0 |
Release all resources allocated. | |
virtual ISwapChain * | createSwapChain (struct WindowData *) |
Create a new swap chain for the specified window. | |
virtual void | deleteSwapChain (ISwapChain *) |
Deletes the specified swap chain. | |
virtual IContext * | getImmediateContext ()=0 |
Get a pointer to the immediate context used to issue commands to the graphics device. | |
virtual IBuffers * | getBuffers ()=0 |
Get a pointer to the buffer management interface. | |
virtual ITextures * | getTextures ()=0 |
Get a pointer to the texture management interface. | |
virtual IRenderTargets * | getRenderTargets ()=0 |
Get a pointer to the render target management interface. | |
virtual IEffects * | getEffects ()=0 |
Get a pointer to the effect management interface. | |
virtual IPipelineStates * | getPipelineStates ()=0 |
Get a pointer to the pipeline state management interface. | |
virtual ICapabilities * | getCapabilities ()=0 |
Get a pointer to the capability management interface used to query the graphics device capability flags. | |
virtual ISwapChain * | getDefaultSwapChain ()=0 |
Get a pointer to the default swap chain for this graphics device. | |
virtual ISyncObjects * | getSyncObjects ()=0 |
Get a pointer to the sync object management interface. | |
virtual void * | getNativeDevice () |
virtual bool | setSettings (const GraphicsDeviceSettings &newSettings) |
Updates the settings associated with this device. | |
const GraphicsDeviceSettings & | getSettings () const |
Public Attributes | |
BuffersVK | buffers |
EffectsVK | effects |
ContextVK | context |
TexturesVK | textures |
RenderTargetsVK | renderTargets |
CapabilitiesVK | capabilities |
SyncObjectsCommon | syncObjects |
VkInstance | instance = VK_NULL_HANDLE |
VkPhysicalDevice | physicalDevice = VK_NULL_HANDLE |
VkDevice | device = VK_NULL_HANDLE |
VkQueue | queue = VK_NULL_HANDLE |
VkPhysicalDeviceFeatures | physicalDeviceFeatures |
VkSurfaceKHR | surface = VK_NULL_HANDLE |
VkSwapchainKHR | swapChain = VK_NULL_HANDLE |
VkCommandPool | commandPool = VK_NULL_HANDLE |
VkCommandBuffer | setupCommands = VK_NULL_HANDLE |
std::vector< VkImage > | swapChainImages |
std::vector< RenderTargetHandle > | framebuffers |
std::vector< TextureHandle > | backBuffers |
std::vector< TextureHandle > | backBuffersMS |
TextureHandle | depthTextureHandle |
VkPhysicalDeviceMemoryProperties | memoryProperties |
uint32_t | currentFrameBuffer = 0 |
VkSemaphore | presentCompleteSemaphore = VK_NULL_HANDLE |
int | width = 1920 |
int | height = 1080 |
bool | needsResize = true |
Additional Inherited Members | |
![]() | |
static void | fillGraphicsSettings (struct WindowData *windowData, int requestedSampleCount) |
Set platform specific graphics settings used for window creation e.g.: XVisualInfo on Linux. | |
![]() | |
GraphicsDeviceSettings | settings |
std::vector< ISwapChain * > | swapChains |
Definition at line 20 of file GraphicsDeviceVK.h.
Cogs::GraphicsDeviceVK::GraphicsDeviceVK | ( | RenderingAllocatorInfo * | allocator | ) |
Definition at line 427 of file GraphicsDeviceVK.cpp.
|
overridevirtual |
Signal the beginning of a new frame to the graphics device.
Implements Cogs::IGraphicsDevice.
Definition at line 577 of file GraphicsDeviceVK.cpp.
|
overridevirtual |
Signal the end of a frame to the graphics device.
When the graphics device itself is responsible for managing the device context (e.g in D3D11), and the PresentFlags::NoSwap flag is not set, this will swap the back buffer to make the result of previous drawing visible.
syncInterval | Synchronization interval.
|
presentFlags | A combination of PresentFlags controlling the presentation of the rendered frame. |
Implements Cogs::IGraphicsDevice.
Definition at line 610 of file GraphicsDeviceVK.cpp.
void Cogs::GraphicsDeviceVK::flushSetup | ( | ) |
Definition at line 495 of file GraphicsDeviceVK.cpp.
|
inlineoverridevirtual |
Get a pointer to the buffer management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 53 of file GraphicsDeviceVK.h.
|
inlinevirtual |
Get a pointer to the capability management interface used to query the graphics device capability flags.
Implements Cogs::IGraphicsDevice.
Definition at line 58 of file GraphicsDeviceVK.h.
VkCommandBuffer Cogs::GraphicsDeviceVK::getCommandBuffer | ( | ) |
Definition at line 669 of file GraphicsDeviceVK.cpp.
|
overridevirtual |
Get a pointer to the default swap chain for this graphics device.
Implements Cogs::IGraphicsDevice.
Definition at line 663 of file GraphicsDeviceVK.cpp.
|
inlineoverridevirtual |
Get a pointer to the effect management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 56 of file GraphicsDeviceVK.h.
|
inlineoverridevirtual |
Get the graphics device identifier.
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 41 of file GraphicsDeviceVK.h.
|
inlineoverridevirtual |
Get a pointer to the immediate context used to issue commands to the graphics device.
Implements Cogs::IGraphicsDevice.
Definition at line 52 of file GraphicsDeviceVK.h.
bool Cogs::GraphicsDeviceVK::getMemoryType | ( | uint32_t | typeBits, |
VkFlags | requirements_mask, | ||
uint32_t * | typeIndex | ||
) |
Definition at line 543 of file GraphicsDeviceVK.cpp.
|
inlineoverridevirtual |
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 50 of file GraphicsDeviceVK.h.
|
inlinevirtual |
Get a pointer to the pipeline state management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 57 of file GraphicsDeviceVK.h.
|
inlinevirtual |
Get a pointer to the render target management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 55 of file GraphicsDeviceVK.h.
|
inline |
Definition at line 64 of file GraphicsDeviceVK.h.
|
overridevirtual |
Retrieve the size previously set by setSize.
Implements Cogs::IGraphicsDevice.
Definition at line 570 of file GraphicsDeviceVK.cpp.
|
inlineoverridevirtual |
Get a pointer to the sync object management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 59 of file GraphicsDeviceVK.h.
|
inlineoverridevirtual |
Get a pointer to the texture management interface.
Implements Cogs::IGraphicsDevice.
Definition at line 54 of file GraphicsDeviceVK.h.
|
inlineoverridevirtual |
Get the type of the graphics device.
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 40 of file GraphicsDeviceVK.h.
References Cogs::Vulkan.
|
overridevirtual |
Initializes the graphics device with the settings previous set through calling setSettings.
Implements Cogs::IGraphicsDevice.
Definition at line 431 of file GraphicsDeviceVK.cpp.
bool Cogs::GraphicsDeviceVK::initializeCommandPool | ( | ) |
Definition at line 408 of file GraphicsDeviceVK.cpp.
bool Cogs::GraphicsDeviceVK::initializeDepth | ( | ) |
Definition at line 488 of file GraphicsDeviceVK.cpp.
bool Cogs::GraphicsDeviceVK::initializeDevice | ( | ) |
Definition at line 188 of file GraphicsDeviceVK.cpp.
bool Cogs::GraphicsDeviceVK::initializeFramebuffers | ( | ) |
Definition at line 522 of file GraphicsDeviceVK.cpp.
bool Cogs::GraphicsDeviceVK::initializeInstance | ( | ) |
Definition at line 45 of file GraphicsDeviceVK.cpp.
bool Cogs::GraphicsDeviceVK::initializeSwapChain | ( | ) |
Definition at line 340 of file GraphicsDeviceVK.cpp.
|
overridevirtual |
Release all resources allocated.
Implements Cogs::IGraphicsDevice.
Definition at line 659 of file GraphicsDeviceVK.cpp.
void Cogs::GraphicsDeviceVK::resize | ( | ) |
Definition at line 702 of file GraphicsDeviceVK.cpp.
|
overridevirtual |
Set the size of the main drawing buffer used by the graphics device in pixels.
width | Width of the drawing buffer in pixels. |
height | Height of the drawing buffer in pixels. |
Implements Cogs::IGraphicsDevice.
Definition at line 560 of file GraphicsDeviceVK.cpp.
|
overridevirtual |
Wait for any GPU commands on the current device to finish before returning.
After this command returns, any commands issued to the graphics device should be finished, and results from these ready to use.
Reimplemented from Cogs::IGraphicsDevice.
Definition at line 654 of file GraphicsDeviceVK.cpp.
std::vector<TextureHandle> Cogs::GraphicsDeviceVK::backBuffers |
Definition at line 92 of file GraphicsDeviceVK.h.
std::vector<TextureHandle> Cogs::GraphicsDeviceVK::backBuffersMS |
Definition at line 93 of file GraphicsDeviceVK.h.
BuffersVK Cogs::GraphicsDeviceVK::buffers |
Definition at line 68 of file GraphicsDeviceVK.h.
CapabilitiesVK Cogs::GraphicsDeviceVK::capabilities |
Definition at line 73 of file GraphicsDeviceVK.h.
VkCommandPool Cogs::GraphicsDeviceVK::commandPool = VK_NULL_HANDLE |
Definition at line 86 of file GraphicsDeviceVK.h.
ContextVK Cogs::GraphicsDeviceVK::context |
Definition at line 70 of file GraphicsDeviceVK.h.
uint32_t Cogs::GraphicsDeviceVK::currentFrameBuffer = 0 |
Definition at line 99 of file GraphicsDeviceVK.h.
TextureHandle Cogs::GraphicsDeviceVK::depthTextureHandle |
Definition at line 95 of file GraphicsDeviceVK.h.
VkDevice Cogs::GraphicsDeviceVK::device = VK_NULL_HANDLE |
Definition at line 78 of file GraphicsDeviceVK.h.
EffectsVK Cogs::GraphicsDeviceVK::effects |
Definition at line 69 of file GraphicsDeviceVK.h.
std::vector<RenderTargetHandle> Cogs::GraphicsDeviceVK::framebuffers |
Definition at line 91 of file GraphicsDeviceVK.h.
int Cogs::GraphicsDeviceVK::height = 1080 |
Definition at line 104 of file GraphicsDeviceVK.h.
VkInstance Cogs::GraphicsDeviceVK::instance = VK_NULL_HANDLE |
Definition at line 76 of file GraphicsDeviceVK.h.
VkPhysicalDeviceMemoryProperties Cogs::GraphicsDeviceVK::memoryProperties |
Definition at line 97 of file GraphicsDeviceVK.h.
bool Cogs::GraphicsDeviceVK::needsResize = true |
Definition at line 105 of file GraphicsDeviceVK.h.
VkPhysicalDevice Cogs::GraphicsDeviceVK::physicalDevice = VK_NULL_HANDLE |
Definition at line 77 of file GraphicsDeviceVK.h.
VkPhysicalDeviceFeatures Cogs::GraphicsDeviceVK::physicalDeviceFeatures |
Definition at line 81 of file GraphicsDeviceVK.h.
VkSemaphore Cogs::GraphicsDeviceVK::presentCompleteSemaphore = VK_NULL_HANDLE |
Definition at line 101 of file GraphicsDeviceVK.h.
VkQueue Cogs::GraphicsDeviceVK::queue = VK_NULL_HANDLE |
Definition at line 79 of file GraphicsDeviceVK.h.
RenderTargetsVK Cogs::GraphicsDeviceVK::renderTargets |
Definition at line 72 of file GraphicsDeviceVK.h.
VkCommandBuffer Cogs::GraphicsDeviceVK::setupCommands = VK_NULL_HANDLE |
Definition at line 87 of file GraphicsDeviceVK.h.
VkSurfaceKHR Cogs::GraphicsDeviceVK::surface = VK_NULL_HANDLE |
Definition at line 83 of file GraphicsDeviceVK.h.
VkSwapchainKHR Cogs::GraphicsDeviceVK::swapChain = VK_NULL_HANDLE |
Definition at line 84 of file GraphicsDeviceVK.h.
std::vector<VkImage> Cogs::GraphicsDeviceVK::swapChainImages |
Definition at line 89 of file GraphicsDeviceVK.h.
SyncObjectsCommon Cogs::GraphicsDeviceVK::syncObjects |
Definition at line 74 of file GraphicsDeviceVK.h.
TexturesVK Cogs::GraphicsDeviceVK::textures |
Definition at line 71 of file GraphicsDeviceVK.h.
int Cogs::GraphicsDeviceVK::width = 1920 |
Definition at line 103 of file GraphicsDeviceVK.h.