![]() |
Raven Engine v0.1
|
Vulkan implementation of the RendererAPI interface. More...
#include <VulkanRenderer.h>
Public Member Functions | |
| void | Init (Window &wnd) override |
| Initializes the VulkanRenderer with a reference to the application window. Creates Vulkan instance, device, surface, and prepares rendering resources. | |
| void | Shutdown () override |
| Cleans up all Vulkan resources and shuts down the renderer. | |
| void | InitCommandBuffers () override |
| Allocates and initializes Vulkan command buffers for rendering. | |
| void | CreateDescriptorPool () |
| Creates the Vulkan descriptor pool used for descriptor set allocations. | |
| void | CreateTimeStampQueryPool () |
| void | GetTimeStampResults () |
| void | BeginFrame () override |
| Begins the frame by acquiring the next swapchain image and preparing command buffers. | |
| void | EndFrame () override |
| Ends the frame, submitting command buffers and presenting the swapchain image. | |
| void | BeginRenderPass (const Ref< RenderPass > &renderPass, const Ref< RenderCommandBuffer > &commandBuffer) override |
| Begins a render pass by recording commands into the provided command buffer. | |
| void | DrawGeometry (Ref< RenderCommandBuffer > commandBuffer, Ref< Pipeline > pipeline, Ref< VertexBuffer > vertexBuffer, Ref< IndexBuffer > indexBuffer, const Crux::mat4 &transform) override |
| Issues a draw call for geometry with vertex and index buffers. | |
| void | DrawStaticMesh (Ref< RenderCommandBuffer > commandBuffer, Ref< Pipeline > pipeline, Ref< Mesh > mesh, const Crux::mat4 &transform) override |
| Issues a draw call for a static mesh. | |
| void | EndRenderPass (const Ref< RenderCommandBuffer > &commandBuffer) override |
| Ends the currently active render pass. | |
| Ref< RenderCommandBuffer > | GetCommandBuffer () const override |
| Gets the primary command buffer for the current frame. | |
| Ref< RenderCommandBuffer > | GetCommandBuffer (u8 index) const override |
| Gets a command buffer by index (for multi-buffering). | |
| u32 | GetImageIndex () const override |
| Gets the current swapchain image index. | |
| void * | GetDescriptorPool () const override |
| Gets the Vulkan descriptor pool handle. | |
| void * | BeginSingleTimeCommand () override |
| Begins recording a single-use command buffer for immediate commands. | |
| void | EndSingleTimeCommand (void *commandBuffer) override |
| Ends recording of a single-use command buffer and submits it. | |
| void | CopyBuffer (void *srcBuffer, void *dstBuffer, u32 size) override |
| Copies data from a source buffer to a destination buffer. | |
| void | CopyBufferToImage (void *srcBuffer, void *dstImage, u32 width, u32 height) override |
| Copies buffer data into an image (texture). | |
| void | TransitionImageLayout (void *image, ImageFormat format, ImageLayout oldLayout, ImageLayout newLayout, u32 mipCount) override |
| Transitions an image layout between usage states (e.g. undefined to shader read). | |
| void | Submit (const StaticMeshSubmission &submission) override |
| Submits a static mesh to be rendered during the current frame. | |
| const std::vector< StaticMeshSubmission > & | GetStaticMeshSubmissions () const override |
| Gets all static mesh submissions queued for the current frame. | |
| void * | GetInstance () const override |
| Gets the raw Vulkan instance handle. | |
| Window & | GetWindow () const override |
| Gets the window reference the renderer is rendering to. | |
| Public Member Functions inherited from Raven::RendererAPI | |
| virtual | ~RendererAPI ()=default |
| Public Member Functions inherited from Raven::Castable< RendererAPI > | |
| T & | As () |
| Non-const version of As<T>(), for casting to a non-const target type. | |
Additional Inherited Members | |
| Public Types inherited from Raven::RendererAPI | |
| enum class | API : u8 { None = 0 , Vulkan = 1 } |
| Supported rendering backends. More... | |
| Static Public Member Functions inherited from Raven::RendererAPI | |
| static API | GetAPI () |
| Returns the current rendering API in use. | |
| static Scope< RendererAPI > | Create () |
| Factory method to create the renderer API instance for the selected backend. | |
| static std::string_view | APIToString () |
| Converts the API enum to a string representation. | |
| Static Public Attributes inherited from Raven::RendererAPI | |
| static float | m_ElapsedTime = 0.0f |
| Elapsed time tracker for rendering, to be improved with GPU timers. | |
Vulkan implementation of the RendererAPI interface.
Responsible for managing Vulkan instance, device, swapchain, command buffers, descriptor pools, and rendering submissions.
|
overridevirtual |
Begins the frame by acquiring the next swapchain image and preparing command buffers.
Implements Raven::RendererAPI.
|
overridevirtual |
Begins a render pass by recording commands into the provided command buffer.
| renderPass | The render pass to begin. |
| commandBuffer | The command buffer to record commands into. |
Implements Raven::RendererAPI.
|
overridevirtual |
Begins recording a single-use command buffer for immediate commands.
Implements Raven::RendererAPI.
|
overridevirtual |
Copies data from a source buffer to a destination buffer.
| srcBuffer | Source Vulkan buffer pointer. |
| dstBuffer | Destination Vulkan buffer pointer. |
| size | Number of bytes to copy. |
Implements Raven::RendererAPI.
|
overridevirtual |
Copies buffer data into an image (texture).
| srcBuffer | Source Vulkan buffer pointer. |
| dstImage | Destination Vulkan image pointer. |
| width | Width of the image. |
| height | Height of the image. |
Implements Raven::RendererAPI.
| void Raven::VulkanRenderer::CreateDescriptorPool | ( | ) |
Creates the Vulkan descriptor pool used for descriptor set allocations.
| void Raven::VulkanRenderer::CreateTimeStampQueryPool | ( | ) |
|
overridevirtual |
Issues a draw call for geometry with vertex and index buffers.
| commandBuffer | The command buffer to record into. |
| pipeline | The graphics pipeline to use. |
| vertexBuffer | The vertex buffer containing geometry vertices. |
| indexBuffer | The index buffer for indexed drawing. |
| transform | Transformation matrix applied to the geometry. |
Implements Raven::RendererAPI.
|
overridevirtual |
Issues a draw call for a static mesh.
| commandBuffer | The command buffer to record into. |
| pipeline | The graphics pipeline to use. |
| mesh | The static mesh to draw. |
| transform | Transformation matrix applied to the mesh. |
Implements Raven::RendererAPI.
|
overridevirtual |
Ends the frame, submitting command buffers and presenting the swapchain image.
Implements Raven::RendererAPI.
|
overridevirtual |
Ends the currently active render pass.
| commandBuffer | The command buffer being recorded. |
Implements Raven::RendererAPI.
|
overridevirtual |
Ends recording of a single-use command buffer and submits it.
| commandBuffer | Raw pointer to the Vulkan command buffer. |
Implements Raven::RendererAPI.
|
inlineoverridevirtual |
Gets the primary command buffer for the current frame.
Implements Raven::RendererAPI.
|
inlineoverridevirtual |
Gets a command buffer by index (for multi-buffering).
| index | Index of the command buffer. |
Implements Raven::RendererAPI.
|
inlineoverridevirtual |
Gets the Vulkan descriptor pool handle.
Implements Raven::RendererAPI.
|
inlineoverridevirtual |
Gets the current swapchain image index.
Implements Raven::RendererAPI.
|
inlineoverridevirtual |
|
inlineoverridevirtual |
Gets all static mesh submissions queued for the current frame.
Implements Raven::RendererAPI.
| void Raven::VulkanRenderer::GetTimeStampResults | ( | ) |
|
inlineoverridevirtual |
Gets the window reference the renderer is rendering to.
Implements Raven::RendererAPI.
|
overridevirtual |
Initializes the VulkanRenderer with a reference to the application window. Creates Vulkan instance, device, surface, and prepares rendering resources.
| wnd | The window to render into. |
Implements Raven::RendererAPI.
|
overridevirtual |
Allocates and initializes Vulkan command buffers for rendering.
Implements Raven::RendererAPI.
|
overridevirtual |
Cleans up all Vulkan resources and shuts down the renderer.
Implements Raven::RendererAPI.
|
overridevirtual |
Submits a static mesh to be rendered during the current frame.
| submission | The mesh submission data. |
Implements Raven::RendererAPI.
|
overridevirtual |
Transitions an image layout between usage states (e.g. undefined to shader read).
| image | Vulkan image pointer. |
| format | Image format. |
| oldLayout | Current image layout. |
| newLayout | Desired image layout. |
| mipCount | Number of mip levels. |
Implements Raven::RendererAPI.