Skip to content

LiteFX::Rendering::GraphicsDevice

Represents the graphics device that a rendering back-end is doing work on.

Synopsis

Declared in <litefx/rendering.hpp>

template<
    typename TFactory,
    typename TSurface,
    typename TGraphicsAdapter,
    typename TSwapChain,
    typename TCommandQueue,
    typename TRenderPass,
    typename TRenderPipeline,
    typename TComputePipeline,
    typename TRayTracingPipeline,
    typename TBarrier>
requires meta::implements<TSurface, ISurface> &&
        meta::implements<TGraphicsAdapter, IGraphicsAdapter> &&
        meta::implements<TSwapChain, SwapChain<typename TFactory::image_type>> &&
        meta::implements<TCommandQueue, CommandQueue<typename TCommandQueue::command_buffer_type>> &&
        meta::implements<TFactory, GraphicsFactory<typename TFactory::descriptor_layout_type, typename TFactory::buffer_type, typename TFactory::vertex_buffer_type, typename TFactory::index_buffer_type, typename TFactory::image_type, typename TFactory::sampler_type, typename TFactory::bottom_level_acceleration_structure_type, typename TFactory::top_level_acceleration_structure_type>> &&
        meta::implements<TRenderPass, RenderPass<TCommandQueue, typename TRenderPass::frame_buffer_type>> &&
        meta::implements<TRenderPipeline, RenderPipeline<typename TRenderPipeline::pipeline_layout_type, typename TRenderPipeline::shader_program_type, typename TRenderPipeline::input_assembler_type, typename TRenderPipeline::rasterizer_type>> &&
        meta::implements<TComputePipeline, ComputePipeline<typename TComputePipeline::pipeline_layout_type, typename TComputePipeline::shader_program_type>> &&
        meta::implements<TRayTracingPipeline, RayTracingPipeline<typename TRayTracingPipeline::pipeline_layout_type, typename TRayTracingPipeline::shader_program_type>> &&
        meta::implements<TBarrier, Barrier<typename TFactory::buffer_type, typename TFactory::image_type>>
class GraphicsDevice
    : public IGraphicsDevice

Description

The graphics device is the central instance of a renderer. It has two major roles. First, it maintains the GraphicsFactory instance, that is used to facilitate common objects. Second, it owns the device state, which contains objects required for communication between your application and the graphics driver. Most notably, those objects contain the SwapChain instance and the CommandQueue instances used for data and command transfer.

Base Classes

NameDescription
IGraphicsDeviceThe interface for a graphics device that.

Type Aliases

Member Functions

NameDescription
~GraphicsDevice [destructor] [virtual]Destructor
adapter [virtual]Returns the graphics adapter, the device uses for drawing.
allocateGlobalDescriptors Allocates a range of descriptors in the global descriptor heaps for the provided descriptorSet.
bindDescriptorSet Binds the descriptors of the descriptor set to the global descriptor heaps.
bindGlobalDescriptorHeaps Binds the global descriptor heap.
buildBarrier [virtual]Returns a builder for a Barrier.
buildComputePipeline [virtual]Returns a builder for a ComputePipeline.
buildInputAssembler [virtual]Returns a builder for a InputAssembler.
buildPipelineLayout [virtual]Returns a builder for a PipelineLayout.
buildRasterizer [virtual]Returns a builder for a Rasterizer.
buildRayTracingPipeline Returns a builder for a RayTracingPipeline.
buildRenderPass Returns a builder for a RenderPass.
buildRenderPipeline [virtual]Returns a builder for a RenderPipeline.
buildShaderProgram [virtual]Returns a builder for a ShaderProgram.
computeAccelerationStructureSizes computeAccelerationStructureSizes overloads
createQueue [virtual]Attempts to create a new queue that supports the combination of queue types specified by the type parameter.
defaultQueue [virtual]Returns the instance of the default ICommandQueue that supports the combination of queue types specified by the type parameter.
factory [virtual]Returns the factory instance, used to create instances from the device.
makeBarrier [virtual]Creates a memory barrier instance.
makeFrameBuffer Creates a new frame buffer instance.
maximumMultiSamplingLevel [virtual]Queries the device for the maximum supported number of multi-sampling levels.
releaseGlobalDescriptors Releases a range of descriptors from the global descriptor heaps.
shared_from_this Returns a shared pointer to the current object instance.
state [virtual]Returns the device state that can be used to manage resources.
surface [virtual]Returns the surface, the device draws to.
swapChain Returns the swap chain, that contains the back and front buffers used for presentation.
ticksPerMillisecond [virtual]Returns the number of GPU ticks per milliseconds.
updateGlobalDescriptors Updates a range of descriptors in the global buffer descriptor heap with the descriptors from descriptorSet.
wait [virtual]Waits until all queues allocated from the device have finished the work issued prior to this point.
weak_from_this Returns a weak pointer to the current object instance.

Protected Types

NameDescription
Allocator An allocator used to allocate the shared object.

Protected Member Functions

NameDescription
GraphicsDevice [constructor]Constructors
operator= Assignment operators

Protected Static Member Functions

NameDescription
create Generic factory method used to create instances of the shared object.

Template Parameters

NameDescription
TFactoryThe type of the graphics factory. Must implement GraphicsFactory.
TSurfaceThe type of the surface. Must implement ISurface.
TGraphicsAdapterThe type of the graphics adapter. Must implement IGraphicsAdapter.
TSwapChainThe type of the swap chain. Must implement SwapChain.
TCommandQueueThe type of the command queue. Must implement CommandQueue.
TRenderPassThe type of the render pass. Must implement RenderPass.
TRenderPipelineThe type of the render pipeline. Must implement RenderPipeline.
TComputePipelineThe type of the compute pipeline. Must implement ComputePipeline.
TRayTracingPipelineThe type of the ray-tracing pipeline. Must implement RayTracingPipeline.
TBarrierThe type of the memory barrier. Must implement Barrier.

Derived Classes

NameDescription
DirectX12Device Implements a DirectX 12 graphics device.
VulkanDevice Implements a Vulkan graphics device.