Raven Engine v0.1
Loading...
Searching...
No Matches
Raven::IllumineRenderer Class Reference

Static interface facade for all renderer operations. More...

#include <IllumineRenderer.h>

Static Public Member Functions

static void Init (Window &wnd, const RendererConfig &config)
 Initialize the renderer with the given window and configuration.
static void Shutdown ()
 Clean up all renderer resources.
static void WaitRender ()
static void InitCommandBuffers ()
 Initialize command buffers for rendering.
static void BeginFrame ()
 Begin a new frame.
static void EndFrame ()
 End the current frame.
static void SetVSync (bool enabled)
 Enable or disable vertical synchronization.
static void BeginRenderPass (const Ref< RenderPass > &renderPass, const Ref< RenderCommandBuffer > &commandBuffer)
 Begin a render pass on the given command buffer.
static void EndRenderPass (const Ref< RenderCommandBuffer > &commandBuffer)
 End the current render pass on the command buffer.
static void DrawGeometry (const Ref< RenderCommandBuffer > &commandBuffer, Ref< Pipeline > pipeline, Ref< VertexBuffer > vertexBuffer, Ref< IndexBuffer > indexBuffer, const Crux::mat4 &transform)
 Record draw commands for arbitrary geometry.
static void DrawStaticMesh (const Ref< RenderCommandBuffer > &commandBuffer, const Ref< Pipeline > &pipeline, const Ref< Mesh > &mesh, const Crux::mat4 &transform)
 Draw a static mesh.
static Ref< RenderCommandBufferGetCommandBuffer ()
 Get the current command buffer for recording rendering commands.
static Ref< RenderCommandBufferGetCommandBuffer (u8 index)
 Get command buffer by index.
static u32 GetImageIndex ()
 Get the current swapchain image index.
static void * GetDescriptorPool ()
 Get the Vulkan descriptor pool pointer.
static void * GetInstance ()
 Get the Vulkan instance pointer.
static void * BeginSingleTimeCommand ()
 Begin recording a single-use command buffer.
static void EndSingleTimeCommand (void *commandBuffer)
 End recording and submit a single-use command buffer.
static void TransitionImageLayout (void *image, ImageFormat format, ImageLayout oldLayout, ImageLayout newLayout, u32 mipCount=0)
 Transition an image from one layout to another.
static void CopyBuffer (void *srcBuffer, void *dstBuffer, u32 size)
 Copy data from one buffer to another.
static void CopyBufferToImage (void *srcBuffer, void *dstImage, u32 width, u32 height)
 Copy buffer data to an image.
static void Submit (const StaticMeshSubmission &s)
 Submit a static mesh for rendering.
static const std::vector< StaticMeshSubmission > & GetStaticMeshSubmissions ()
 Get the list of static mesh submissions queued for this frame.
static Ref< ShaderLibraryGetShaderLibrary ()
 Get the shader library used by the renderer.
static Ref< MaterialRegistryGetMaterialRegistry ()
static RendererConfigGetConfig ()
 Get the current renderer configuration.
static RendererDataGetRenderData ()
 Get current runtime renderer data (stats, etc).
static WindowGetWindow ()
 Get the window associated with the renderer.
static SwapchainGetSwapchain ()
 Get the swapchain currently used by the renderer.
static bool ShouldRecreate ()
 Check if the renderer requests swapchain recreation.
static void QueueRecreate ()
 Mark the swapchain for recreation.
static void Recreated ()
 Clear the swapchain recreation request flag.
static void RegisterShaderDependency (Shader *shader, Pipeline *pipeline)
 Registers a pipeline to a shader for reloading.
static void RegisterPipelineDependency (Pipeline *pipeline, RenderPass *renderpass)
 Registers a renderpass to a pipeline for reloading.
static void OnShaderReloaded (const Ref< Shader > &shader)
 Queues up a shader for reload at the beginning of the next frame.
static void ProcessShaderReloadQueue ()
 Rebuilds pipelines and rebakes descriptors attached to the pipeline.
static RendererAPIGetRendererAPI ()
 Access the underlying RendererAPI implementation.

Detailed Description

Static interface facade for all renderer operations.

Delegates all rendering commands and resource management to the internal RendererAPI implementation. Provides frame lifecycle methods, command buffer handling, mesh submissions, and utility functions for image transitions and buffer copies.

Member Function Documentation

◆ BeginFrame()

void Raven::IllumineRenderer::BeginFrame ( )
static

Begin a new frame.

Prepares the renderer and command buffers for issuing draw commands. Must be called at the start of every frame.

◆ BeginRenderPass()

void Raven::IllumineRenderer::BeginRenderPass ( const Ref< RenderPass > & renderPass,
const Ref< RenderCommandBuffer > & commandBuffer )
static

Begin a render pass on the given command buffer.

Parameters
renderPassThe render pass object defining attachments and subpasses.
commandBufferCommand buffer to record commands into.

Prepares the GPU for rendering according to the specified render pass.

◆ BeginSingleTimeCommand()

void * Raven::IllumineRenderer::BeginSingleTimeCommand ( )
static

Begin recording a single-use command buffer.

Returns
Raw pointer to the command buffer.

Used for short-lived GPU operations like buffer copies or layout transitions.

◆ CopyBuffer()

void Raven::IllumineRenderer::CopyBuffer ( void * srcBuffer,
void * dstBuffer,
u32 size )
static

Copy data from one buffer to another.

Parameters
srcBufferSource buffer pointer.
dstBufferDestination buffer pointer.
sizeSize in bytes to copy.

◆ CopyBufferToImage()

void Raven::IllumineRenderer::CopyBufferToImage ( void * srcBuffer,
void * dstImage,
u32 width,
u32 height )
static

Copy buffer data to an image.

Parameters
srcBufferSource buffer pointer.
dstImageDestination image pointer.
widthWidth of the target image.
heightHeight of the target image.

◆ DrawGeometry()

void Raven::IllumineRenderer::DrawGeometry ( const Ref< RenderCommandBuffer > & commandBuffer,
Ref< Pipeline > pipeline,
Ref< VertexBuffer > vertexBuffer,
Ref< IndexBuffer > indexBuffer,
const Crux::mat4 & transform )
static

Record draw commands for arbitrary geometry.

Parameters
commandBufferCommand buffer to record draw calls.
pipelinePipeline to bind for rendering.
vertexBufferVertex buffer containing geometry.
indexBufferIndex buffer defining geometry topology.
transformModel transform matrix.

Issues draw commands for the given geometry with the specified transform.

◆ DrawStaticMesh()

void Raven::IllumineRenderer::DrawStaticMesh ( const Ref< RenderCommandBuffer > & commandBuffer,
const Ref< Pipeline > & pipeline,
const Ref< Mesh > & mesh,
const Crux::mat4 & transform )
static

Draw a static mesh.

Parameters
commandBufferCommand buffer to record draw calls.
pipelinePipeline to bind for rendering.
meshStatic mesh to draw.
transformModel transform matrix.

Submits all vertex and index buffers associated with the static mesh.

◆ EndFrame()

void Raven::IllumineRenderer::EndFrame ( )
static

End the current frame.

Submits command buffers to the GPU and presents the swapchain image. Must be called after all draw calls for the frame are done.

◆ EndRenderPass()

void Raven::IllumineRenderer::EndRenderPass ( const Ref< RenderCommandBuffer > & commandBuffer)
static

End the current render pass on the command buffer.

Parameters
commandBufferCommand buffer to end the render pass on.

Signals the GPU to finish rendering operations for this pass.

◆ EndSingleTimeCommand()

void Raven::IllumineRenderer::EndSingleTimeCommand ( void * commandBuffer)
static

End recording and submit a single-use command buffer.

Parameters
commandBufferPointer to the command buffer to submit.

◆ GetCommandBuffer() [1/2]

Ref< RenderCommandBuffer > Raven::IllumineRenderer::GetCommandBuffer ( )
static

Get the current command buffer for recording rendering commands.

Returns
Reference-counted pointer to the command buffer.

◆ GetCommandBuffer() [2/2]

Ref< RenderCommandBuffer > Raven::IllumineRenderer::GetCommandBuffer ( u8 index)
static

Get command buffer by index.

Parameters
indexIndex of the command buffer (typically frame index).
Returns
Reference-counted pointer to the command buffer.

◆ GetConfig()

RendererConfig & Raven::IllumineRenderer::GetConfig ( )
static

Get the current renderer configuration.

Returns
Reference to the configuration struct.

◆ GetDescriptorPool()

void * Raven::IllumineRenderer::GetDescriptorPool ( )
static

Get the Vulkan descriptor pool pointer.

Returns
Raw pointer to the Vulkan descriptor pool.

Exposes the descriptor pool for low-level descriptor management.

◆ GetImageIndex()

u32 Raven::IllumineRenderer::GetImageIndex ( )
static

Get the current swapchain image index.

Returns
Index of the swapchain image currently targeted for rendering.

◆ GetInstance()

void * Raven::IllumineRenderer::GetInstance ( )
static

Get the Vulkan instance pointer.

Returns
Raw pointer to the Vulkan instance.

◆ GetMaterialRegistry()

Ref< MaterialRegistry > Raven::IllumineRenderer::GetMaterialRegistry ( )
static

◆ GetRenderData()

RendererData & Raven::IllumineRenderer::GetRenderData ( )
static

Get current runtime renderer data (stats, etc).

Returns
Reference to the renderer data.

◆ GetRendererAPI()

RendererAPI & Raven::IllumineRenderer::GetRendererAPI ( )
inlinestatic

Access the underlying RendererAPI implementation.

Returns
Reference to RendererAPI.

◆ GetShaderLibrary()

Ref< ShaderLibrary > Raven::IllumineRenderer::GetShaderLibrary ( )
static

Get the shader library used by the renderer.

Returns
Reference to the shader library.

◆ GetStaticMeshSubmissions()

const std::vector< StaticMeshSubmission > & Raven::IllumineRenderer::GetStaticMeshSubmissions ( )
static

Get the list of static mesh submissions queued for this frame.

Returns
Vector of static mesh submissions.

◆ GetSwapchain()

Swapchain & Raven::IllumineRenderer::GetSwapchain ( )
inlinestatic

Get the swapchain currently used by the renderer.

Returns
Reference to the swapchain.

◆ GetWindow()

Window & Raven::IllumineRenderer::GetWindow ( )
inlinestatic

Get the window associated with the renderer.

Returns
Reference to the window.

◆ Init()

void Raven::IllumineRenderer::Init ( Window & wnd,
const RendererConfig & config )
static

Initialize the renderer with the given window and configuration.

Parameters
wndReference to the window to render to.
configRenderer configuration settings.

Sets up the RendererAPI, swapchain, command buffers, and necessary resources. Must be called before any rendering commands.

◆ InitCommandBuffers()

void Raven::IllumineRenderer::InitCommandBuffers ( )
static

Initialize command buffers for rendering.

Prepares command buffers for use in the current frames in flight.

◆ OnShaderReloaded()

void Raven::IllumineRenderer::OnShaderReloaded ( const Ref< Shader > & shader)
static

Queues up a shader for reload at the beginning of the next frame.

Note
The shader gets recompiled earlier, this will mark it as Reloaded

◆ ProcessShaderReloadQueue()

void Raven::IllumineRenderer::ProcessShaderReloadQueue ( )
static

Rebuilds pipelines and rebakes descriptors attached to the pipeline.

◆ QueueRecreate()

void Raven::IllumineRenderer::QueueRecreate ( )
inlinestatic

Mark the swapchain for recreation.

◆ Recreated()

void Raven::IllumineRenderer::Recreated ( )
inlinestatic

Clear the swapchain recreation request flag.

◆ RegisterPipelineDependency()

void Raven::IllumineRenderer::RegisterPipelineDependency ( Pipeline * pipeline,
RenderPass * renderpass )
static

Registers a renderpass to a pipeline for reloading.

◆ RegisterShaderDependency()

void Raven::IllumineRenderer::RegisterShaderDependency ( Shader * shader,
Pipeline * pipeline )
static

Registers a pipeline to a shader for reloading.

◆ SetVSync()

void Raven::IllumineRenderer::SetVSync ( bool enabled)
static

Enable or disable vertical synchronization.

Parameters
enabledTrue to enable VSync, false to disable.

Updates swapchain and presentation settings accordingly.

◆ ShouldRecreate()

bool Raven::IllumineRenderer::ShouldRecreate ( )
inlinestatic

Check if the renderer requests swapchain recreation.

Returns
True if swapchain needs to be recreated.

◆ Shutdown()

void Raven::IllumineRenderer::Shutdown ( )
static

Clean up all renderer resources.

Releases all allocated GPU and CPU-side resources. Must be called before application shutdown.

◆ Submit()

void Raven::IllumineRenderer::Submit ( const StaticMeshSubmission & s)
static

Submit a static mesh for rendering.

Parameters
sStatic mesh submission data.

◆ TransitionImageLayout()

void Raven::IllumineRenderer::TransitionImageLayout ( void * image,
ImageFormat format,
ImageLayout oldLayout,
ImageLayout newLayout,
u32 mipCount = 0 )
static

Transition an image from one layout to another.

Parameters
imagePointer to the Vulkan image.
formatImage format.
oldLayoutCurrent layout of the image.
newLayoutTarget layout to transition to.
mipCountNumber of mipmap levels to transition (default 0 = all).

◆ WaitRender()

void Raven::IllumineRenderer::WaitRender ( )
static

The documentation for this class was generated from the following files: