NDEVR
API Documentation
VulkanSession

Creates and manages the resources necessary for converting a DesignObjectLookup into 3D rendered data in the Vulkan engine. More...

Inheritance diagram for VulkanSession:
[legend]
Collaboration diagram for VulkanSession:
[legend]

Public Member Functions

virtual void cleanResources () final override
 Cleans up stale or unused GPU resources.
void commit (GraphicsUpdateArguments &args) final override
 Commits pending changes to the GPU.
bool createPipeline (GraphicsUpdateArguments &args) final override
 Creates or recreates the rendering pipeline.
DynamicPointer< GraphicsPipelinecreateRenderPipeline () final override
 Creates a new render pipeline for a viewport.
virtual const ConstPointer< GraphicsDevice > & device () const final override
 Returns the graphics device (const).
virtual const DynamicPointer< GraphicsDevice > & device () final override
 Returns the graphics device.
virtual void drawFrame (GraphicsUpdateArguments &) final override
 Renders a single frame.
virtual void ensureLastRenderComplete () final override
 Blocks until the last submitted render is complete.
bool hasCommand () const override
 Checks whether there are pending commands to execute.
virtual void init (GraphicsUpdateArguments &) final override
 Initializes the pipeline with the given arguments.
virtual void postClearAll () final override
 Called after all scene objects have been cleared.
bool runCommand (GraphicsUpdateArguments &args) final override
 Executes a queued rendering command.
virtual void setWindowInstance (WindowInstance *) final override
 Associates a window instance with this pipeline.
void updateUniformBuffer (GraphicsUpdateArguments &args) final override
 Updates the camera uniform buffer on the GPU.
virtual UUID uuid () final override
 Returns the unique identifier for this session.
Public Member Functions inherited from GraphicsSession
virtual ~GraphicsSession ()
 Destructor.
virtual void addCamera (const UUID &object)
 Adds a camera to this session.
bool isActive () const
 Checks whether this session is active.
virtual void readShader (const StringView &shader)=0
 Reads and compiles a shader for use in rendering.
virtual void removeCamera (const UUID &camera)
 Removes a camera from this session.
void setActive (bool active)
 Sets whether this session is active.
Public Member Functions inherited from GraphicsPipeline
virtual ~GraphicsPipeline ()
 Destructor.

Protected Types

enum  RasterizerType {
  e_filled_cull_cw , e_filled_cull_ccw , e_filled_cull_none , e_outline ,
  e_size
}
 Types of rasterizer configurations used during rendering. More...

Protected Member Functions

bool addRenderGeometry (const Geometry &geo) override
 Adds a geometry for rendering.
void cleanup () final override
 Releases all GPU resources.
void removeRenderGeometry (const Geometry &geo) override
 Removes a geometry from rendering.

Additional Inherited Members

Public Types inherited from GraphicsSession
enum  AddObjectMode { e_add_object , e_ensure_pipeline , e_ensure_pipeline_and_add }
 Modes for adding objects to the session. More...
Protected Attributes inherited from GraphicsSession
Buffer< UUIDm_added_cameras
 Cameras registered with this session.
bool m_is_active = false
 Whether this session is currently active.
bool m_needs_clear_all = false
 Whether a full clear is pending.
bool m_needs_command_refresh = false
 Whether command buffers need refreshing.

Detailed Description

Creates and manages the resources necessary for converting a DesignObjectLookup into 3D rendered data in the Vulkan engine.


Definition at line 50 of file VulkanSession.h.

Member Enumeration Documentation

◆ RasterizerType

Types of rasterizer configurations used during rendering.

Enumerator
e_filled_cull_cw 

Filled polygons with clockwise face culling.

e_filled_cull_ccw 

Filled polygons with counter-clockwise face culling.

e_filled_cull_none 

Filled polygons with no face culling.

e_outline 

Outline/wireframe rendering.

e_size 

The number of rasterizer types (sentinel).

Definition at line 110 of file VulkanSession.h.

Member Function Documentation

◆ addRenderGeometry()

bool VulkanSession::addRenderGeometry ( const Geometry & geo)
overrideprotectedvirtual

Adds a geometry for rendering.

Parameters
[in]geoThe geometry to add.
Returns
True if the geometry was added.

Implements GraphicsSession.

◆ commit()

void VulkanSession::commit ( GraphicsUpdateArguments & args)
finaloverridevirtual

Commits pending changes to the GPU.

Parameters
[in]argsThe update arguments.

Implements GraphicsPipeline.

◆ createPipeline()

bool VulkanSession::createPipeline ( GraphicsUpdateArguments & args)
finaloverridevirtual

Creates or recreates the rendering pipeline.

Parameters
[in]argsThe update arguments.
Returns
True if the pipeline was created successfully.

Implements GraphicsPipeline.

◆ createRenderPipeline()

DynamicPointer< GraphicsPipeline > VulkanSession::createRenderPipeline ( )
finaloverridevirtual

Creates a new render pipeline for a viewport.

Returns
The created pipeline.

Implements GraphicsSession.

References UUID::CreateUUID().

◆ device() [1/2]

virtual const ConstPointer< GraphicsDevice > & VulkanSession::device ( ) const
inlinefinaloverridevirtual

Returns the graphics device (const).

Returns
Const reference to the device pointer.

Implements GraphicsPipeline.

Definition at line 56 of file VulkanSession.h.

Referenced by QtVulkanSession::QtVulkanSession().

◆ device() [2/2]

virtual const DynamicPointer< GraphicsDevice > & VulkanSession::device ( )
inlinefinaloverridevirtual

Returns the graphics device.

Returns
Reference to the device pointer.

Implements GraphicsPipeline.

Definition at line 57 of file VulkanSession.h.

◆ drawFrame()

virtual void VulkanSession::drawFrame ( GraphicsUpdateArguments & args)
inlinefinaloverridevirtual

Renders a single frame.

Parameters
[in]argsThe update arguments.

Implements GraphicsPipeline.

Definition at line 82 of file VulkanSession.h.

◆ hasCommand()

bool VulkanSession::hasCommand ( ) const
overridevirtual

Checks whether there are pending commands to execute.

Returns
True if commands are pending.

Implements GraphicsPipeline.

◆ init()

virtual void VulkanSession::init ( GraphicsUpdateArguments & args)
inlinefinaloverridevirtual

Initializes the pipeline with the given arguments.

Parameters
[in]argsThe update arguments.

Implements GraphicsPipeline.

Definition at line 86 of file VulkanSession.h.

◆ removeRenderGeometry()

void VulkanSession::removeRenderGeometry ( const Geometry & geo)
overrideprotectedvirtual

Removes a geometry from rendering.

Parameters
[in]geoThe geometry to remove.

Implements GraphicsSession.

◆ runCommand()

bool VulkanSession::runCommand ( GraphicsUpdateArguments & args)
finaloverridevirtual

Executes a queued rendering command.

Parameters
[in]argsThe update arguments.
Returns
True if a command was executed.

Implements GraphicsPipeline.

References runCommand().

Referenced by runCommand().

◆ setWindowInstance()

virtual void VulkanSession::setWindowInstance ( WindowInstance * instance)
inlinefinaloverridevirtual

Associates a window instance with this pipeline.

Parameters
[in]instanceThe window instance.

Implements GraphicsPipeline.

Definition at line 84 of file VulkanSession.h.

◆ updateUniformBuffer()

void VulkanSession::updateUniformBuffer ( GraphicsUpdateArguments & args)
finaloverridevirtual

Updates the camera uniform buffer on the GPU.

Parameters
[in]argsThe update arguments.

Implements GraphicsPipeline.

◆ uuid()

virtual UUID VulkanSession::uuid ( )
inlinefinaloverridevirtual

Returns the unique identifier for this session.

Returns
The session UUID.

Implements GraphicsSession.

Definition at line 80 of file VulkanSession.h.


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