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 TDescriptorRange,
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>> &&
meta::implements<TDescriptorRange, IDescriptorRange>
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
Type Aliases
Member Functions
| Name | Description |
~GraphicsDevice [destructor] [virtual] | Destructor |
adapter [virtual] | Returns the graphics adapter, the device uses for drawing. |
allocateGlobalDescriptors | allocateGlobalDescriptors overloads |
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. |
descriptorHeaps [virtual] | Returns the global descriptor heaps from which all descriptors in the device are allocated. |
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. |
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. |
supportsStorageImageFormat [virtual] | Returns true, if format can be used in writable images, i.e., as RWTexture<T>. |
supportsTexelBufferFormat [virtual] | Returns true, if format can be used in texel buffers, i.e., as Buffer<T>, or as RWBuffer<T> if writable is set. |
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
| Name | Description |
Allocator | An allocator used to allocate the shared object. |
Protected Member Functions
Protected Static Member Functions
| Name | Description |
create | Generic factory method used to create instances of the shared object. |
Template Parameters
| Name | Description |
| TFactory | The type of the graphics factory. Must implement GraphicsFactory. |
| TSurface | The type of the surface. Must implement ISurface. |
| TGraphicsAdapter | The type of the graphics adapter. Must implement IGraphicsAdapter. |
| TSwapChain | The type of the swap chain. Must implement SwapChain. |
| TCommandQueue | The type of the command queue. Must implement CommandQueue. |
| TRenderPass | The type of the render pass. Must implement RenderPass. |
| TDescriptorRange | The type of the descriptor range. Must implement IDescriptorRange. |
| TRenderPipeline | The type of the render pipeline. Must implement RenderPipeline. |
| TComputePipeline | The type of the compute pipeline. Must implement ComputePipeline. |
| TRayTracingPipeline | The type of the ray-tracing pipeline. Must implement RayTracingPipeline. |
| TBarrier | The type of the memory barrier. Must implement Barrier. |
Derived Classes