Lugdunum  0.1.0
Classes | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
lug::Graphics::Vulkan::Renderer Class Referencefinal

#include <Renderer.hpp>

Inheritance diagram for lug::Graphics::Vulkan::Renderer:
[legend]
Collaboration diagram for lug::Graphics::Vulkan::Renderer:
[legend]

Classes

struct  Preferences
 
struct  Requirements
 

Public Member Functions

 Renderer (Graphics &graphics)
 
 Renderer (const Renderer &)=delete
 
 Renderer (Renderer &&)=delete
 
Rendereroperator= (const Renderer &)=delete
 
Rendereroperator= (Renderer &&)=delete
 
 ~Renderer ()
 
bool beginInit (const std::string &appName, const Core::Version &appVersion, const Renderer::InitInfo &initInfo) override final
 
bool finishInit () override final
 
bool isInstanceLayerLoaded (const char *name) const
 
bool isInstanceExtensionLoaded (const char *name) const
 
bool isDeviceExtensionLoaded (const char *name) const
 
::lug::Graphics::Render::WindowcreateWindow (Render::Window::InitInfo &initInfo) override final
 
::lug::Graphics::Render::WindowgetWindow () override final
 
const API::InstancegetInstance () const
 
API::DevicegetDevice ()
 
const API::DevicegetDevice () const
 
InstanceInfogetInstanceInfo ()
 
const InstanceInfogetInstanceInfo () const
 
PhysicalDeviceInfogetPhysicalDeviceInfo ()
 
const PhysicalDeviceInfogetPhysicalDeviceInfo () const
 
std::vector< PhysicalDeviceInfo > & getPhysicalDeviceInfos ()
 
const std::vector< PhysicalDeviceInfo > & getPhysicalDeviceInfos () const
 
PreferencesgetPreferences ()
 
const PreferencesgetPreferences () const
 
void addPipeline (Resource::SharedPtr< Render::Pipeline > pipeline)
 
bool containsPipeline (Render::Pipeline::Id id) const
 
Resource::SharedPtr< Render::PipelinegetPipeline (Render::Pipeline::Id id)
 
Render::WindowgetRenderWindow () const
 
void destroy ()
 
bool beginFrame (const lug::System::Time &elapsedTime) override final
 
bool endFrame () override final
 
- Public Member Functions inherited from lug::Graphics::Renderer
 Renderer (Graphics &graphics, Type type)
 
 Renderer (const Renderer &)=delete
 
 Renderer (Renderer &&)=delete
 
Rendereroperator= (const Renderer &)=delete
 
Rendereroperator= (Renderer &&)=delete
 
const InitInfogetInfo () const
 
Type getType () const
 
const DisplayModegetDisplayMode () const
 
void setDisplayMode (DisplayMode displayMode)
 
ResourceManagergetResourceManager () const
 

Private Member Functions

bool initInstance (const std::string &appName, const Core::Version &appVersion)
 
bool initDevice ()
 
bool checkRequirementsInstance (const std::set< Module::Type > &modulesToCheck)
 
bool checkRequirementsDevice (const PhysicalDeviceInfo &physicalDeviceInfo, const std::set< Module::Type > &modulesToCheck, bool finalization, bool quiet)
 
template<typename Info >
std::vector< const char * > checkRequirementsLayers (const Info &info, const std::vector< const char *> &layers, std::vector< const char *> &layersFound)
 
template<typename Info >
std::vector< const char * > checkRequirementsExtensions (const Info &info, const std::vector< const char *> &extensions, std::vector< const char *> &extensionsFound)
 

Private Attributes

API::Loader _loader
 
API::Instance _instance {}
 
API::Device _device {}
 
InstanceInfo _instanceInfo {}
 
PhysicalDeviceInfo_physicalDeviceInfo {nullptr}
 
std::vector< PhysicalDeviceInfo_physicalDeviceInfos {}
 
VkDebugReportCallbackEXT _debugReportCallback {VK_NULL_HANDLE}
 
std::unique_ptr< Render::Window_window
 
std::vector< const char * > _loadedInstanceLayers {}
 
std::vector< const char * > _loadedInstanceExtensions {}
 
std::vector< const char * > _loadedDeviceExtensions {}
 
VkPhysicalDeviceFeatures _loadedDeviceFeatures {}
 
std::vector< Render::Mesh * > _attachedMeshes {}
 
Preferences _preferences
 
std::unordered_map< Render::Pipeline::Id, Resource::WeakPtr< Render::Pipeline > > _pipelines
 

Static Private Attributes

static const std::unordered_map< Module::Type, RequirementsmodulesRequirements
 

Additional Inherited Members

- Public Types inherited from lug::Graphics::Renderer
enum  Type : uint8_t { Type::Vulkan }
 
enum  DisplayMode : uint8_t {
  DisplayMode::Full, DisplayMode::Albedo, DisplayMode::Normal, DisplayMode::Metallic,
  DisplayMode::Roughness, DisplayMode::AmbientOcclusion, DisplayMode::AmbientOcclusionRoughnessMetallic, DisplayMode::Emissive
}
 
- Protected Attributes inherited from lug::Graphics::Renderer
Graphics_graphics
 
Type _type
 
DisplayMode _displayMode
 
InitInfo _initInfo
 
std::unique_ptr< ResourceManager_resourceManager {nullptr}
 

Detailed Description

Definition at line 21 of file Renderer.hpp.

Constructor & Destructor Documentation

◆ Renderer() [1/3]

lug::Graphics::Vulkan::Renderer::Renderer ( Graphics graphics)
explicit

Definition at line 56 of file Renderer.cpp.

◆ Renderer() [2/3]

lug::Graphics::Vulkan::Renderer::Renderer ( const Renderer )
delete

◆ Renderer() [3/3]

lug::Graphics::Vulkan::Renderer::Renderer ( Renderer &&  )
delete

◆ ~Renderer()

lug::Graphics::Vulkan::Renderer::~Renderer ( )
virtual

Reimplemented from lug::Graphics::Renderer.

Definition at line 58 of file Renderer.cpp.

Member Function Documentation

◆ operator=() [1/2]

Renderer& lug::Graphics::Vulkan::Renderer::operator= ( const Renderer )
delete

◆ operator=() [2/2]

Renderer& lug::Graphics::Vulkan::Renderer::operator= ( Renderer &&  )
delete

◆ beginInit()

bool lug::Graphics::Vulkan::Renderer::beginInit ( const std::string &  appName,
const Core::Version appVersion,
const Renderer::InitInfo initInfo 
)
finaloverridevirtual

Implements lug::Graphics::Renderer.

Definition at line 86 of file Renderer.cpp.

◆ finishInit()

bool lug::Graphics::Vulkan::Renderer::finishInit ( )
finaloverridevirtual

Implements lug::Graphics::Renderer.

Definition at line 98 of file Renderer.cpp.

◆ isInstanceLayerLoaded()

bool Renderer::isInstanceLayerLoaded ( const char *  name) const
inline

Definition at line 1 of file Renderer.inl.

◆ isInstanceExtensionLoaded()

bool Renderer::isInstanceExtensionLoaded ( const char *  name) const
inline

Definition at line 9 of file Renderer.inl.

◆ isDeviceExtensionLoaded()

bool Renderer::isDeviceExtensionLoaded ( const char *  name) const
inline

Definition at line 17 of file Renderer.inl.

◆ createWindow()

lug::Graphics::Render::Window * lug::Graphics::Vulkan::Renderer::createWindow ( Render::Window::InitInfo initInfo)
finaloverridevirtual

Implements lug::Graphics::Renderer.

Definition at line 562 of file Renderer.cpp.

◆ getWindow()

lug::Graphics::Render::Window * lug::Graphics::Vulkan::Renderer::getWindow ( )
finaloverridevirtual

Implements lug::Graphics::Renderer.

Definition at line 574 of file Renderer.cpp.

◆ getInstance()

const API::Instance & Renderer::getInstance ( ) const
inline

Definition at line 25 of file Renderer.inl.

◆ getDevice() [1/2]

API::Device & Renderer::getDevice ( )
inline

Definition at line 29 of file Renderer.inl.

◆ getDevice() [2/2]

const API::Device & Renderer::getDevice ( ) const
inline

Definition at line 33 of file Renderer.inl.

◆ getInstanceInfo() [1/2]

InstanceInfo & Renderer::getInstanceInfo ( )
inline

Definition at line 37 of file Renderer.inl.

◆ getInstanceInfo() [2/2]

const InstanceInfo & Renderer::getInstanceInfo ( ) const
inline

Definition at line 41 of file Renderer.inl.

◆ getPhysicalDeviceInfo() [1/2]

PhysicalDeviceInfo * Renderer::getPhysicalDeviceInfo ( )
inline

Definition at line 45 of file Renderer.inl.

◆ getPhysicalDeviceInfo() [2/2]

const PhysicalDeviceInfo * Renderer::getPhysicalDeviceInfo ( ) const
inline

Definition at line 49 of file Renderer.inl.

◆ getPhysicalDeviceInfos() [1/2]

std::vector< PhysicalDeviceInfo > & Renderer::getPhysicalDeviceInfos ( )
inline

Definition at line 53 of file Renderer.inl.

◆ getPhysicalDeviceInfos() [2/2]

const std::vector< PhysicalDeviceInfo > & Renderer::getPhysicalDeviceInfos ( ) const
inline

Definition at line 57 of file Renderer.inl.

◆ getPreferences() [1/2]

Renderer::Preferences & Renderer::getPreferences ( )
inline

Definition at line 61 of file Renderer.inl.

◆ getPreferences() [2/2]

const Renderer::Preferences & Renderer::getPreferences ( ) const
inline

Definition at line 65 of file Renderer.inl.

◆ addPipeline()

void Renderer::addPipeline ( Resource::SharedPtr< Render::Pipeline pipeline)
inline

Definition at line 69 of file Renderer.inl.

◆ containsPipeline()

bool Renderer::containsPipeline ( Render::Pipeline::Id  id) const
inline

Definition at line 73 of file Renderer.inl.

◆ getPipeline()

Resource::SharedPtr< Render::Pipeline > Renderer::getPipeline ( Render::Pipeline::Id  id)
inline

Definition at line 77 of file Renderer.inl.

◆ getRenderWindow()

Render::Window * Renderer::getRenderWindow ( ) const
inline

Definition at line 85 of file Renderer.inl.

◆ destroy()

void lug::Graphics::Vulkan::Renderer::destroy ( )

Definition at line 62 of file Renderer.cpp.

◆ beginFrame()

bool lug::Graphics::Vulkan::Renderer::beginFrame ( const lug::System::Time elapsedTime)
finaloverridevirtual

Implements lug::Graphics::Renderer.

Definition at line 578 of file Renderer.cpp.

◆ endFrame()

bool lug::Graphics::Vulkan::Renderer::endFrame ( )
finaloverridevirtual

Implements lug::Graphics::Renderer.

Definition at line 582 of file Renderer.cpp.

◆ initInstance()

bool lug::Graphics::Vulkan::Renderer::initInstance ( const std::string &  appName,
const Core::Version appVersion 
)
private

Definition at line 128 of file Renderer.cpp.

◆ initDevice()

bool lug::Graphics::Vulkan::Renderer::initDevice ( )
private

Definition at line 303 of file Renderer.cpp.

◆ checkRequirementsInstance()

bool lug::Graphics::Vulkan::Renderer::checkRequirementsInstance ( const std::set< Module::Type > &  modulesToCheck)
private

Definition at line 389 of file Renderer.cpp.

◆ checkRequirementsDevice()

bool lug::Graphics::Vulkan::Renderer::checkRequirementsDevice ( const PhysicalDeviceInfo physicalDeviceInfo,
const std::set< Module::Type > &  modulesToCheck,
bool  finalization,
bool  quiet 
)
private

Definition at line 449 of file Renderer.cpp.

◆ checkRequirementsLayers()

template<typename Info >
std::vector< const char * > lug::Graphics::Vulkan::Renderer::checkRequirementsLayers ( const Info &  info,
const std::vector< const char *> &  layers,
std::vector< const char *> &  layersFound 
)
inlineprivate

Definition at line 533 of file Renderer.cpp.

◆ checkRequirementsExtensions()

template<typename Info >
std::vector< const char * > lug::Graphics::Vulkan::Renderer::checkRequirementsExtensions ( const Info &  info,
const std::vector< const char *> &  extensions,
std::vector< const char *> &  extensionsFound 
)
inlineprivate

Definition at line 548 of file Renderer.cpp.

Member Data Documentation

◆ _loader

API::Loader lug::Graphics::Vulkan::Renderer::_loader
private

Definition at line 112 of file Renderer.hpp.

◆ _instance

API::Instance lug::Graphics::Vulkan::Renderer::_instance {}
private

Definition at line 114 of file Renderer.hpp.

◆ _device

API::Device lug::Graphics::Vulkan::Renderer::_device {}
private

Definition at line 115 of file Renderer.hpp.

◆ _instanceInfo

InstanceInfo lug::Graphics::Vulkan::Renderer::_instanceInfo {}
private

Definition at line 117 of file Renderer.hpp.

◆ _physicalDeviceInfo

PhysicalDeviceInfo* lug::Graphics::Vulkan::Renderer::_physicalDeviceInfo {nullptr}
private

Definition at line 118 of file Renderer.hpp.

◆ _physicalDeviceInfos

std::vector<PhysicalDeviceInfo> lug::Graphics::Vulkan::Renderer::_physicalDeviceInfos {}
private

Definition at line 119 of file Renderer.hpp.

◆ _debugReportCallback

VkDebugReportCallbackEXT lug::Graphics::Vulkan::Renderer::_debugReportCallback {VK_NULL_HANDLE}
private

Definition at line 121 of file Renderer.hpp.

◆ _window

std::unique_ptr<Render::Window> lug::Graphics::Vulkan::Renderer::_window
private

Definition at line 123 of file Renderer.hpp.

◆ _loadedInstanceLayers

std::vector<const char*> lug::Graphics::Vulkan::Renderer::_loadedInstanceLayers {}
private

Definition at line 125 of file Renderer.hpp.

◆ _loadedInstanceExtensions

std::vector<const char*> lug::Graphics::Vulkan::Renderer::_loadedInstanceExtensions {}
private

Definition at line 126 of file Renderer.hpp.

◆ _loadedDeviceExtensions

std::vector<const char*> lug::Graphics::Vulkan::Renderer::_loadedDeviceExtensions {}
private

Definition at line 127 of file Renderer.hpp.

◆ _loadedDeviceFeatures

VkPhysicalDeviceFeatures lug::Graphics::Vulkan::Renderer::_loadedDeviceFeatures {}
private

Definition at line 128 of file Renderer.hpp.

◆ _attachedMeshes

std::vector<Render::Mesh*> lug::Graphics::Vulkan::Renderer::_attachedMeshes {}
private

Definition at line 129 of file Renderer.hpp.

◆ _preferences

Preferences lug::Graphics::Vulkan::Renderer::_preferences
private
Initial value:
{
nullptr,
{
{
VK_PRESENT_MODE_MAILBOX_KHR,
VK_PRESENT_MODE_FIFO_KHR
},
{
VK_FORMAT_B8G8R8A8_UNORM,
VK_FORMAT_R8G8B8A8_UNORM
},
{
VK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR,
VK_COMPOSITE_ALPHA_INHERIT_BIT_KHR
}
}
}

Definition at line 131 of file Renderer.hpp.

◆ _pipelines

std::unordered_map<Render::Pipeline::Id, Resource::WeakPtr<Render::Pipeline> > lug::Graphics::Vulkan::Renderer::_pipelines
private

Definition at line 150 of file Renderer.hpp.

◆ modulesRequirements

const std::unordered_map< Module::Type, Renderer::Requirements > lug::Graphics::Vulkan::Renderer::modulesRequirements
staticprivate
Initial value:
= {
#define LUG_INIT_GRAPHICS_MODULES_REQUIREMENTS(name)
}

Definition at line 153 of file Renderer.hpp.


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