LiteFX 0.4.1.2025
Computer Graphics Engine
|
Defines a back-end, that provides a device instance for a certain surface and graphics adapter. More...
#include <rendering.hpp>
Inherits LiteFX::Rendering::IRenderBackend.
Public Types | |
using | device_type = TGraphicsDevice |
using | surface_type = device_type::surface_type |
using | adapter_type = device_type::adapter_type |
using | swap_chain_type = device_type::swap_chain_type |
using | command_queue_type = device_type::command_queue_type |
using | command_buffer_type = device_type::command_buffer_type |
using | factory_type = device_type::factory_type |
using | barrier_type = device_type::barrier_type |
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 | frame_buffer_type = device_type::frame_buffer_type |
using | render_pass_type = device_type::render_pass_type |
using | pipeline_layout_type = device_type::pipeline_layout_type |
using | render_pipeline_type = device_type::render_pipeline_type |
using | compute_pipeline_type = device_type::compute_pipeline_type |
using | ray_tracing_pipeline_type = device_type::ray_tracing_pipeline_type |
using | shader_program_type = device_type::shader_program_type |
using | input_assembler_type = device_type::input_assembler_type |
using | rasterizer_type = device_type::rasterizer_type |
Public Member Functions | |||
~RenderBackend () noexcept override=default | |||
virtual const Array< SharedPtr< const adapter_type > > & | adapters () const =0 | ||
const adapter_type * | findAdapter (const Optional< UInt64 > &adapterId=std::nullopt) const noexcept override=0 | ||
Finds an adapter using its unique ID.Note that the adapter ID is optional, which allows the back-end to return a default adapter instance. Which adapter is used as default adapter, depends on the actual back-end implementation. The interface does not make any constraints on the default adapter to choose. A naive implementation might simply return the first available adapter. | |||
virtual void | registerDevice (const String &name, SharedPtr< device_type > &&device)=0 | ||
template<typename TSelf , typename ... TArgs> | |||
device_type & | createDevice (this TSelf &self, const String &name, const adapter_type &adapter, UniquePtr< surface_type > &&surface, TArgs &&... _args) | ||
Creates a new graphics device. | |||
virtual void | releaseDevice (const String &name)=0 | ||
Destroys and removes a device from the backend. | |||
device_type * | device (const String &name) noexcept override=0 | ||
Looks up a device and returns a pointer to it, or nullptr , if no device with the provided name could be found.
| |||
const device_type * | device (const String &name) const noexcept override=0 | ||
Looks up a device and returns a pointer to it, or nullptr , if no device with the provided name could be found.
| |||
const device_type * | operator[] (const String &name) const noexcept override | ||
Looks up a device and returns a pointer to it, or nullptr , if no device with the provided name could be found.
| |||
device_type * | operator[] (const String &name) noexcept override | ||
Looks up a device and returns a pointer to it, or nullptr , if no device with the provided name could be found.
| |||
![]() | |||
~IRenderBackend () noexcept override=default | |||
Enumerable< SharedPtr< const IGraphicsAdapter > > | listAdapters () const | ||
Lists all available graphics adapters. | |||
![]() | |||
virtual | ~IBackend () noexcept=default | ||
virtual BackendType | type () const noexcept=0 | ||
Gets the type of the backend. | |||
const BackendState & | state () const noexcept | ||
Returns the state of the backend. | |||
virtual StringView | name () const noexcept=0 | ||
Gets the name of the backend. | |||
Protected Member Functions | |
RenderBackend () noexcept=default | |
RenderBackend (RenderBackend &&) noexcept=default | |
RenderBackend (const RenderBackend &)=default | |
RenderBackend & | operator= (RenderBackend &&) noexcept=default |
RenderBackend & | operator= (const RenderBackend &)=default |
![]() | |
IRenderBackend () noexcept=default | |
IRenderBackend (IRenderBackend &&) noexcept=default | |
IRenderBackend (const IRenderBackend &)=default | |
IRenderBackend & | operator= (const IRenderBackend &)=default |
IRenderBackend & | operator= (IRenderBackend &&) noexcept=default |
![]() | |
IBackend () noexcept=default | |
IBackend (const IBackend &)=default | |
IBackend (IBackend &&) noexcept=default | |
IBackend & | operator= (const IBackend &)=default |
IBackend & | operator= (IBackend &&) noexcept=default |
BackendState & | state () noexcept |
Returns the state of the backend. | |
virtual void | activate ()=0 |
Called by the parent App, if the backend is started. | |
virtual void | deactivate ()=0 |
Called by the parent App, if the backend is stopped. | |
Defines a back-end, that provides a device instance for a certain surface and graphics adapter.
TGraphicsDevice | The type of the graphics device. Must implement GraphicsDevice. |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::adapter_type = device_type::adapter_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::barrier_type = device_type::barrier_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::buffer_type = factory_type::buffer_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::command_buffer_type = device_type::command_buffer_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::command_queue_type = device_type::command_queue_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::compute_pipeline_type = device_type::compute_pipeline_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::descriptor_layout_type = factory_type::descriptor_layout_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::device_type = TGraphicsDevice |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::factory_type = device_type::factory_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::frame_buffer_type = device_type::frame_buffer_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::image_type = factory_type::image_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::index_buffer_type = factory_type::index_buffer_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::input_assembler_type = device_type::input_assembler_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::pipeline_layout_type = device_type::pipeline_layout_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::rasterizer_type = device_type::rasterizer_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::ray_tracing_pipeline_type = device_type::ray_tracing_pipeline_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::render_pass_type = device_type::render_pass_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::render_pipeline_type = device_type::render_pipeline_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::sampler_type = factory_type::sampler_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::shader_program_type = device_type::shader_program_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::surface_type = device_type::surface_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::swap_chain_type = device_type::swap_chain_type |
using LiteFX::Rendering::RenderBackend< TGraphicsDevice >::vertex_buffer_type = factory_type::vertex_buffer_type |
|
protecteddefaultnoexcept |
|
protecteddefaultnoexcept |
|
protecteddefault |
|
overridedefaultnoexcept |
|
pure virtual |
Implemented in LiteFX::Rendering::Backends::DirectX12Backend, and LiteFX::Rendering::Backends::VulkanBackend.
|
inline |
Creates a new graphics device.
_args | The arguments that are passed to the graphics device constructor. |
|
overridepure virtualnoexcept |
Looks up a device and returns a pointer to it, or nullptr
, if no device with the provided name could be found.
name | The name of the device. |
nullptr
, if no device could be found.Implements LiteFX::Rendering::IRenderBackend.
Implemented in LiteFX::Rendering::Backends::DirectX12Backend, and LiteFX::Rendering::Backends::VulkanBackend.
|
overridepure virtualnoexcept |
Looks up a device and returns a pointer to it, or nullptr
, if no device with the provided name could be found.
name | The name of the device. |
nullptr
, if no device could be found.Implements LiteFX::Rendering::IRenderBackend.
Implemented in LiteFX::Rendering::Backends::DirectX12Backend, and LiteFX::Rendering::Backends::VulkanBackend.
|
overridepure virtualnoexcept |
Finds an adapter using its unique ID.Note that the adapter ID is optional, which allows the back-end to return a default adapter instance. Which adapter is used as default adapter, depends on the actual back-end implementation. The interface does not make any constraints on the default adapter to choose. A naive implementation might simply return the first available adapter.
Implements LiteFX::Rendering::IRenderBackend.
Implemented in LiteFX::Rendering::Backends::DirectX12Backend, and LiteFX::Rendering::Backends::VulkanBackend.
|
protecteddefault |
|
protecteddefaultnoexcept |
|
inlineoverridevirtualnoexcept |
Looks up a device and returns a pointer to it, or nullptr
, if no device with the provided name could be found.
name | The name of the device. |
nullptr
, if no device could be found.Reimplemented from LiteFX::Rendering::IRenderBackend.
|
inlineoverridevirtualnoexcept |
Looks up a device and returns a pointer to it, or nullptr
, if no device with the provided name could be found.
name | The name of the device. |
nullptr
, if no device could be found.Reimplemented from LiteFX::Rendering::IRenderBackend.
|
pure virtual |
|
pure virtual |
Destroys and removes a device from the backend.
name | The name of the device. |
Implemented in LiteFX::Rendering::Backends::DirectX12Backend, and LiteFX::Rendering::Backends::VulkanBackend.