13#include "vulkan/vulkan.h"
59 virtual void Clear()
override;
78 virtual void DrawIndexed(std::shared_ptr<VertexArray> vertexArray)
override;
160 const std::vector<VkCommandBuffer>& GetCommandBuffers()
const {
return m_commandBuffers; }
161 const int& GetMaxFramesInFlight()
const {
return MAX_FRAMES_IN_FLIGHT; }
162 const std::vector<VkFence>& GetFences()
const {
return m_InFlightFences; }
163 const std::vector<VkSemaphore>& GetImageAvailableSemaphores()
const {
return m_ImageAvailableSemaphores; }
164 const std::vector<VkSemaphore> GetRenderFinishedSemaphore()
const {
return m_RenderFinishedSemaphores; }
167 size_t m_CurrentFrame = 0;
169 std::vector<VkCommandBuffer> m_commandBuffers;
170 std::vector<std::shared_ptr<VulkanVertexArray>> m_VulkaVertexArrays;
172 std::vector<VkSemaphore> m_ImageAvailableSemaphores;
173 std::vector<VkSemaphore> m_RenderFinishedSemaphores;
174 std::vector<VkFence> m_InFlightFences;
178 const int MAX_FRAMES_IN_FLIGHT = 2;
180 bool m_bAllocateCommandBuffers;
#define KARMA_API
Defining Karma's API macro for storage class information.
Definition Core.h:41
This file contains the class RendererAPI.
An abstract class for a renderer.
Definition RendererAPI.h:21
void RecreateCommandBuffersPipelineSwapchain()
Recreates command buffers, graphics pipelines, and uniform buffer objects when swapchain is recreated...
Definition VulkanRendererAPI.cpp:238
virtual void DrawIndexed(std::shared_ptr< VertexArray > vertexArray) override
Routine for drawing primitives.
Definition VulkanRendererAPI.cpp:262
virtual void Clear() override
Clear the rendering screen. Not much use in Vulkan as such since we record commands in command buffer...
Definition VulkanRendererAPI.cpp:32
void RecreateCommandBuffersAndSwapChain()
Recreates command buffers and swapchain when swapchain is recreated (like on window resize when acqui...
Definition VulkanRendererAPI.cpp:228
void RecordCommandBuffers(VkCommandBuffer commandBuffer, uint32_t imageIndex)
Records the command buffers with rendering commands for a particular image in the swapchain.
Definition VulkanRendererAPI.cpp:62
virtual void SetClearColor(const glm::vec4 &color) override
Sets the color to be used for clear (rendering) screen.
Definition VulkanRendererAPI.cpp:27
void ClearVulkanRendererAPI()
Clears up VulkanRendererAPI specific resources like command buffers and synchronization objects.
Definition VulkanRendererAPI.cpp:16
void CreateSynchronicity()
Creates synchronization objects like semaphores and fences for coordinating rendering operations.
Definition VulkanRendererAPI.cpp:122
void RemoveSynchronicity()
Removes synchronization objects like semaphores and fences.
Definition VulkanRendererAPI.cpp:150
virtual void EndScene() override
Instructions for end of the scene.
Definition VulkanRendererAPI.cpp:112
VulkanRendererAPI()
A constructor.
Definition VulkanRendererAPI.cpp:8
void AllocateCommandBuffers()
Allocates resources for command buffers.
Definition VulkanRendererAPI.cpp:46
virtual void BeginScene() override
Setting up resources for rendering of a scene which includes allocating command buffers if not alread...
Definition VulkanRendererAPI.cpp:36
void SubmitCommandBuffers()
Submits the recorded command buffers to the graphics queue for execution.
Definition VulkanRendererAPI.cpp:162
Vulkan specific implementation of VertexArray class.
Definition VulkanVertexArray.h:34