LiteFX 0.4.1.2025
Computer Graphics Engine
|
Represents the graphics device that a rendering back-end is doing work on. More...
#include <rendering.hpp>
Inherits LiteFX::Rendering::IGraphicsDevice.
Public Types | |
using | surface_type = TSurface |
using | adapter_type = TGraphicsAdapter |
using | swap_chain_type = TSwapChain |
using | command_queue_type = TCommandQueue |
using | command_buffer_type = command_queue_type::command_buffer_type |
using | factory_type = TFactory |
using | barrier_type = TBarrier |
using | descriptor_layout_type = factory_type::descriptor_layout_type |
using | vertex_buffer_type = factory_type::vertex_buffer_type |
using | index_buffer_type = factory_type::index_buffer_type |
using | buffer_type = factory_type::buffer_type |
using | image_type = factory_type::image_type |
using | sampler_type = factory_type::sampler_type |
using | bottom_level_acceleration_structure_type = factory_type::bottom_level_acceleration_structure_type |
using | top_level_acceleration_structure_type = factory_type::top_level_acceleration_structure_type |
using | render_pass_type = TRenderPass |
using | frame_buffer_type = render_pass_type::frame_buffer_type |
using | render_pipeline_type = TRenderPipeline |
using | compute_pipeline_type = TComputePipeline |
using | ray_tracing_pipeline_type = TRayTracingPipeline |
using | pipeline_layout_type = render_pipeline_type::pipeline_layout_type |
using | shader_program_type = render_pipeline_type::shader_program_type |
using | input_assembler_type = render_pipeline_type::input_assembler_type |
using | rasterizer_type = render_pipeline_type::rasterizer_type |
Public Member Functions | |
~GraphicsDevice () noexcept override=default | |
const surface_type & | surface () const noexcept override=0 |
Returns the surface, the device draws to.
| |
const adapter_type & | adapter () const noexcept override=0 |
Returns the graphics adapter, the device uses for drawing.
| |
const swap_chain_type & | swapChain () const noexcept override=0 |
Returns the swap chain, that contains the back and front buffers used for presentation.
| |
swap_chain_type & | swapChain () noexcept override=0 |
Returns the swap chain, that contains the back and front buffers used for presentation.
| |
const factory_type & | factory () const noexcept override=0 |
Returns the factory instance, used to create instances from the device.
| |
virtual const command_queue_type & | defaultQueue (QueueType type) const =0 |
virtual SharedPtr< const command_queue_type > | createQueue (QueueType type, QueuePriority priority=QueuePriority::Normal)=0 |
virtual UniquePtr< barrier_type > | makeBarrier (PipelineStage syncBefore, PipelineStage syncAfter) const =0 |
SharedPtr< frame_buffer_type > | makeFrameBuffer (const Size2d &renderArea) const |
virtual SharedPtr< frame_buffer_type > | makeFrameBuffer (StringView name, const Size2d &renderArea) const =0 |
virtual void | computeAccelerationStructureSizes (const bottom_level_acceleration_structure_type &blas, UInt64 &bufferSize, UInt64 &scratchSize, bool forUpdate=false) const =0 |
virtual void | computeAccelerationStructureSizes (const top_level_acceleration_structure_type &tlas, UInt64 &bufferSize, UInt64 &scratchSize, bool forUpdate=false) const =0 |
![]() | |
~IGraphicsDevice () noexcept override=default | |
virtual DeviceState & | state () const noexcept=0 |
Returns the device state that can be used to manage resources. | |
const ICommandQueue & | defaultQueue (QueueType type) const |
Returns the instance of the default ICommandQueue that supports the combination of queue types specified by the type parameter. | |
SharedPtr< const ICommandQueue > | createQueue (QueueType type, QueuePriority priority=QueuePriority::Normal) |
Attempts to create a new queue that supports the combination of queue types specified by the type parameter. | |
UniquePtr< IBarrier > | makeBarrier (PipelineStage syncBefore, PipelineStage syncAfter) const |
Creates a memory barrier instance. | |
SharedPtr< IFrameBuffer > | makeFrameBuffer (const Size2d &renderArea) const |
Creates a new frame buffer instance. | |
SharedPtr< IFrameBuffer > | makeFrameBuffer (StringView name, const Size2d &renderArea) const |
Creates a new frame buffer instance. | |
virtual MultiSamplingLevel | maximumMultiSamplingLevel (Format format) const noexcept=0 |
Queries the device for the maximum supported number of multi-sampling levels. | |
virtual double | ticksPerMillisecond () const noexcept=0 |
Returns the number of GPU ticks per milliseconds. | |
void | computeAccelerationStructureSizes (const IBottomLevelAccelerationStructure &blas, UInt64 &bufferSize, UInt64 &scratchSize, bool forUpdate=false) const |
Computes the required amount of device memory for an IBottomLevelAccelerationStructure. | |
void | computeAccelerationStructureSizes (const ITopLevelAccelerationStructure &tlas, UInt64 &bufferSize, UInt64 &scratchSize, bool forUpdate=false) const |
Computes the required amount of device memory for an ITopLevelAccelerationStructure. | |
virtual void | wait () const =0 |
Waits until all queues allocated from the device have finished the work issued prior to this point. | |
![]() | |
virtual | ~SharedObject () noexcept=default |
Destroys the shared object. | |
template<typename TSelf > | |
auto | shared_from_this (this TSelf &&self) noexcept |
Returns a shared pointer to the current object instance. | |
template<typename TSelf > | |
auto | weak_from_this (this TSelf &&self) noexcept -> WeakPtr< std::remove_reference_t< TSelf > > |
Returns a weak pointer to the current object instance. | |
Protected Member Functions | |
GraphicsDevice () noexcept=default | |
GraphicsDevice (GraphicsDevice &&) noexcept=default | |
GraphicsDevice (const GraphicsDevice &)=default | |
GraphicsDevice & | operator= (GraphicsDevice &&) noexcept=default |
GraphicsDevice & | operator= (const GraphicsDevice &)=default |
![]() | |
IGraphicsDevice () noexcept=default | |
IGraphicsDevice (IGraphicsDevice &&) noexcept=default | |
IGraphicsDevice (const IGraphicsDevice &)=default | |
IGraphicsDevice & | operator= (const IGraphicsDevice &)=default |
IGraphicsDevice & | operator= (IGraphicsDevice &&) noexcept=default |
![]() | |
SharedObject () noexcept=default | |
Initializes a new shared object. | |
SharedObject (SharedObject &&) noexcept=default | |
SharedObject (const SharedObject &)=default | |
SharedObject & | operator= (SharedObject &&) noexcept=default |
SharedObject & | operator= (const SharedObject &)=default |
Additional Inherited Members | |
![]() | |
template<typename T , typename... TArgs> | |
static auto | create (TArgs &&... args) -> SharedPtr< T > |
Generic factory method used to create instances of the shared object. | |
Represents the graphics device that a rendering back-end is doing work on.
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.
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. |
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. |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::adapter_type = TGraphicsAdapter |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::barrier_type = TBarrier |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::bottom_level_acceleration_structure_type = factory_type::bottom_level_acceleration_structure_type |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::buffer_type = factory_type::buffer_type |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::command_buffer_type = command_queue_type::command_buffer_type |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::command_queue_type = TCommandQueue |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::compute_pipeline_type = TComputePipeline |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::descriptor_layout_type = factory_type::descriptor_layout_type |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::factory_type = TFactory |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::frame_buffer_type = render_pass_type::frame_buffer_type |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::image_type = factory_type::image_type |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::index_buffer_type = factory_type::index_buffer_type |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::input_assembler_type = render_pipeline_type::input_assembler_type |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::pipeline_layout_type = render_pipeline_type::pipeline_layout_type |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::rasterizer_type = render_pipeline_type::rasterizer_type |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::ray_tracing_pipeline_type = TRayTracingPipeline |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::render_pass_type = TRenderPass |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::render_pipeline_type = TRenderPipeline |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::sampler_type = factory_type::sampler_type |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::shader_program_type = render_pipeline_type::shader_program_type |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::surface_type = TSurface |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::swap_chain_type = TSwapChain |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::top_level_acceleration_structure_type = factory_type::top_level_acceleration_structure_type |
using LiteFX::Rendering::GraphicsDevice< TFactory, TSurface, TGraphicsAdapter, TSwapChain, TCommandQueue, TRenderPass, TRenderPipeline, TComputePipeline, TRayTracingPipeline, TBarrier >::vertex_buffer_type = factory_type::vertex_buffer_type |
|
protecteddefaultnoexcept |
|
protecteddefaultnoexcept |
|
protecteddefault |
|
overridedefaultnoexcept |
|
overridepure virtualnoexcept |
Returns the graphics adapter, the device uses for drawing.
Implements LiteFX::Rendering::IGraphicsDevice.
Implemented in LiteFX::Rendering::Backends::DirectX12Device, and LiteFX::Rendering::Backends::VulkanDevice.
|
pure virtual |
|
pure virtual |
|
pure virtual |
Implemented in LiteFX::Rendering::Backends::DirectX12Device, and LiteFX::Rendering::Backends::VulkanDevice.
|
pure virtual |
Implemented in LiteFX::Rendering::Backends::DirectX12Device, and LiteFX::Rendering::Backends::VulkanDevice.
|
overridepure virtualnoexcept |
Returns the factory instance, used to create instances from the device.
Implements LiteFX::Rendering::IGraphicsDevice.
Implemented in LiteFX::Rendering::Backends::DirectX12Device, and LiteFX::Rendering::Backends::VulkanDevice.
|
nodiscardpure virtual |
Implemented in LiteFX::Rendering::Backends::DirectX12Device, and LiteFX::Rendering::Backends::VulkanDevice.
|
inlinenodiscard |
|
nodiscardpure virtual |
Implemented in LiteFX::Rendering::Backends::DirectX12Device, and LiteFX::Rendering::Backends::VulkanDevice.
|
protecteddefault |
|
protecteddefaultnoexcept |
|
overridepure virtualnoexcept |
Returns the surface, the device draws to.
Implements LiteFX::Rendering::IGraphicsDevice.
Implemented in LiteFX::Rendering::Backends::DirectX12Device, and LiteFX::Rendering::Backends::VulkanDevice.
|
overridepure virtualnoexcept |
Returns the swap chain, that contains the back and front buffers used for presentation.
Implements LiteFX::Rendering::IGraphicsDevice.
Implemented in LiteFX::Rendering::Backends::DirectX12Device, and LiteFX::Rendering::Backends::VulkanDevice.
|
overridepure virtualnoexcept |
Returns the swap chain, that contains the back and front buffers used for presentation.
Implements LiteFX::Rendering::IGraphicsDevice.
Implemented in LiteFX::Rendering::Backends::DirectX12Device, and LiteFX::Rendering::Backends::VulkanDevice.