GraphicCore

Graphic core interface.

Overview

Typical use cases:

  • Providing Vulkan-specific core graphics functionality and resource management

Header

<RaeptorCogs/GAPI/Vulkan/Core/Internal/GraphicCore.hpp>

Metadata

Author

Estorc

Version

v1.0

Copyright

Copyright (c) 2025 Estorc MIT License.

Classes

Classes

Class

Description

RaeptorCogs::GAPI::Vulkan::GraphicCore

No description.

class GraphicCore : public RaeptorCogs::GAPI::Common::GraphicCore

Public Functions

inline GraphicCore(Common::RendererBackend &renderer)

Constructor for GraphicCore.

Initializes the GraphicCore with a reference to the renderer backend.

Parameters:

renderer – Reference to the renderer backend.

void createRenderPass(VkFormat swapchainImageFormat)

Create Vulkan render pass.

Note

Initializes the renderPass member.

Parameters:

swapchainImageFormat – Format of the swapchain images.

inline VkInstance &getInstance()

Get the Vulkan instance.

Returns:

Vulkan instance.

inline VkPhysicalDevice &getPhysicalDevice()

Get the Vulkan physical device.

Returns:

Vulkan physical device.

inline VkDevice &getDevice()

Get the Vulkan logical device.

Returns:

Vulkan logical device.

inline VkQueue &getGraphicsQueue()

Get the Vulkan graphics queue.

Returns:

Vulkan graphics queue.

inline VkQueue &getPresentQueue()

Get the Vulkan present queue.

Returns:

Vulkan present queue.

inline VkPipelineCache &getPipelineCache()

Get the Vulkan pipeline cache.

Returns:

Vulkan pipeline cache.

inline VkRenderPass &getRenderPass()

Get the Vulkan render pass.

Returns:

Vulkan render pass.

inline VkCommandPool &getCommandPool()

Get the Vulkan command pool.

Returns:

Vulkan command pool.

inline VkCommandBuffer &getCommandBuffer()

Get the Vulkan command buffer.

Returns:

Vulkan command buffer.

virtual void setViewport(int x, int y, int width, int height) override

virtual void clearSwapchainBuffers() override

virtual void useBlend() override

virtual void bindMaskTexture() override

virtual void setTextureUniform(ObjectHandler<Common::Shader> shader) override

virtual void setMaskTextureUniform(ObjectHandler<Common::Shader> shader) override

virtual void drawElementsInstancedBaseVertexBaseInstance(size_t count, size_t instanceCount, size_t first, int baseVertex, unsigned int baseInstance) override

virtual void bindGraphicTexture(Graphic2D &graphic) override

virtual void enableStencilGuarding() override

Private Members

VkInstance instance

Vulkan instance.

Represents the Vulkan instance.

VkPhysicalDevice physicalDevice

Vulkan physical device.

Represents the Vulkan physical device.

VkDevice device

Vulkan logical device.

Represents the Vulkan logical device.

VkQueue graphicsQueue

Vulkan graphics queue.

Handles graphics commands.

VkQueue presentQueue

Vulkan present queue.

Handles presentation commands.

VkPipelineCache pipelineCache

Vulkan pipeline cache.

Caches pipeline state objects.

VkRenderPass renderPass = VK_NULL_HANDLE

Vulkan render pass.

Defines the render pass configuration.

Note

Lazily initialized in createRenderPass().

VkCommandPool commandPool

Vulkan command pool.

Manages the allocation of command buffers.

VkCommandBuffer commandBuffer

Vulkan command buffer.

Records rendering commands.

Variables

int RaeptorCogs::GAPI::Vulkan::DEFAULT_DYNAMIC_DATA_BUFFER_SIZE = (MAX_SPRITES * INSTANCE_SIZE)

Default size of the dynamic instance data buffer.

int RaeptorCogs::GAPI::Vulkan::INSTANCE_SIZE = 32

Width of the instance data texture.

int RaeptorCogs::GAPI::Vulkan::MAX_SPRITES = 8000000

Maximum number of sprites supported.

int RaeptorCogs::GAPI::Vulkan::STATIC_INSTANCE_DATA_SIZE = (MAX_SPRITES * sizeof(Common::StaticInstanceData))

Size of the static instance data buffer.