MAGE  v0.171.0
Matthias Advanced Game Engine
mage::rendering::OutputManager Class Reference

#include <output_manager.hpp>

Public Member Functions

 OutputManager (ID3D11Device &device, DisplayConfiguration &display_configuration, SwapChain &swap_chain)
 
 OutputManager (const OutputManager &manager)=delete
 
 OutputManager (OutputManager &&manager) noexcept
 
 ~OutputManager ()
 
OutputManageroperator= (const OutputManager &manager)=delete
 
OutputManageroperator= (OutputManager &&manager) noexcept
 
void BindBegin (ID3D11DeviceContext &device_context) const noexcept
 
void BindBeginViewport (ID3D11DeviceContext &device_context) const noexcept
 
void BindBeginGBuffer (ID3D11DeviceContext &device_context) const noexcept
 
void BindEndGBuffer (ID3D11DeviceContext &device_context) const noexcept
 
void BindBeginDeferred (ID3D11DeviceContext &device_context) const noexcept
 
void BindEndDeferred (ID3D11DeviceContext &device_context) const noexcept
 
void BindBeginForward (ID3D11DeviceContext &device_context) const noexcept
 
void BindEndForward (ID3D11DeviceContext &device_context) const noexcept
 
void BindBeginResolve (ID3D11DeviceContext &device_context) const noexcept
 
void BindEndResolve (ID3D11DeviceContext &device_context) const noexcept
 
void BindBeginPostProcessing (ID3D11DeviceContext &device_context) const noexcept
 
void BindPingPong (ID3D11DeviceContext &device_context) const noexcept
 
void BindEndPostProcessing (ID3D11DeviceContext &device_context) const noexcept
 
void BindEndViewport (ID3D11DeviceContext &device_context) const noexcept
 
void BindGUI (ID3D11DeviceContext &device_context) const noexcept
 
void BindEnd (ID3D11DeviceContext &device_context) const noexcept
 

Private Types

enum  SRVIndex : U8 {
  SRVIndex::HDR = 0, SRVIndex::GBuffer_BaseColor, SRVIndex::GBuffer_Material, SRVIndex::GBuffer_Normal,
  SRVIndex::GBuffer_Depth, SRVIndex::PostProcessing_HDR0, SRVIndex::PostProcessing_HDR1, SRVIndex::PostProcessing_Normal,
  SRVIndex::PostProcessing_Depth, SRVIndex::LDR, SRVIndex::Count
}
 
enum  RTVIndex : U8 {
  RTVIndex::HDR = 0, RTVIndex::GBuffer_BaseColor, RTVIndex::GBuffer_Material, RTVIndex::GBuffer_Normal,
  RTVIndex::PostProcessing_HDR0, RTVIndex::PostProcessing_HDR1, RTVIndex::LDR, RTVIndex::Count
}
 
enum  UAVIndex : U8 {
  UAVIndex::HDR = 0, UAVIndex::PostProcessing_HDR0, UAVIndex::PostProcessing_HDR1, UAVIndex::PostProcessing_Normal,
  UAVIndex::PostProcessing_Depth, UAVIndex::LDR, UAVIndex::Count
}
 

Private Member Functions

ID3D11ShaderResourceView * GetSRV (SRVIndex index) const noexcept
 
NotNull< ID3D11ShaderResourceView **> ReleaseAndGetAddressOfSRV (SRVIndex index) noexcept
 
ID3D11RenderTargetView * GetRTV (RTVIndex index) const noexcept
 
NotNull< ID3D11RenderTargetView **> ReleaseAndGetAddressOfRTV (RTVIndex index) noexcept
 
ID3D11UnorderedAccessView * GetUAV (UAVIndex index) const noexcept
 
NotNull< ID3D11UnorderedAccessView **> ReleaseAndGetAddressOfUAV (UAVIndex index) noexcept
 
void SetupBuffers ()
 
void SetupBuffer (const U32x3 &resolution, DXGI_FORMAT format, ID3D11ShaderResourceView **srv, ID3D11RenderTargetView **rtv, ID3D11UnorderedAccessView **uav)
 
void SetupDepthBuffer (const U32x3 &resolution)
 

Private Attributes

std::reference_wrapper< DisplayConfigurationm_display_configuration
 
std::reference_wrapper< ID3D11Device > m_device
 
std::reference_wrapper< SwapChainm_swap_chain
 
ComPtr< ID3D11ShaderResourceView > m_srvs [static_cast< std::size_t >(SRVIndex::Count)]
 
ComPtr< ID3D11RenderTargetView > m_rtvs [static_cast< std::size_t >(RTVIndex::Count)]
 
ComPtr< ID3D11UnorderedAccessView > m_uavs [static_cast< std::size_t >(UAVIndex::Count)]
 
ComPtr< ID3D11DepthStencilView > m_dsv
 
bool m_hdr0_to_hdr1
 
bool m_msaa
 
bool m_ssaa
 

Detailed Description

A class of output managers.

Member Enumeration Documentation

◆ RTVIndex

Enumerator
HDR 
GBuffer_BaseColor 
GBuffer_Material 
GBuffer_Normal 
PostProcessing_HDR0 
PostProcessing_HDR1 
LDR 
Count 

◆ SRVIndex

Enumerator
HDR 
GBuffer_BaseColor 
GBuffer_Material 
GBuffer_Normal 
GBuffer_Depth 
PostProcessing_HDR0 
PostProcessing_HDR1 
PostProcessing_Normal 
PostProcessing_Depth 
LDR 
Count 

◆ UAVIndex

Enumerator
HDR 
PostProcessing_HDR0 
PostProcessing_HDR1 
PostProcessing_Normal 
PostProcessing_Depth 
LDR 
Count 

Constructor & Destructor Documentation

◆ OutputManager() [1/3]

mage::rendering::OutputManager::OutputManager ( ID3D11Device &  device,
DisplayConfiguration display_configuration,
SwapChain swap_chain 
)
explicit

Constructs a output manager.

Parameters
[in]deviceA reference to the device.
[in]display_configurationA reference to the display configuration.
[in]swap_chainA reference to the swap chain.
Exceptions
ExceptionFailed to setup the rendering outputs of this output manager.

◆ OutputManager() [2/3]

mage::rendering::OutputManager::OutputManager ( const OutputManager manager)
delete

Constructs a output manager from the given output manager.

Parameters
[in]managerA reference to the output manager to copy.

◆ OutputManager() [3/3]

mage::rendering::OutputManager::OutputManager ( OutputManager &&  manager)
defaultnoexcept

Constructs a output manager by moving the given output manager.

Parameters
[in]managerA reference to the output manager to move.

◆ ~OutputManager()

mage::rendering::OutputManager::~OutputManager ( )
default

Destructs this output manager.

Member Function Documentation

◆ BindBegin()

void mage::rendering::OutputManager::BindBegin ( ID3D11DeviceContext &  device_context) const
noexcept

◆ BindBeginDeferred()

void mage::rendering::OutputManager::BindBeginDeferred ( ID3D11DeviceContext &  device_context) const
noexcept

◆ BindBeginForward()

void mage::rendering::OutputManager::BindBeginForward ( ID3D11DeviceContext &  device_context) const
noexcept

◆ BindBeginGBuffer()

void mage::rendering::OutputManager::BindBeginGBuffer ( ID3D11DeviceContext &  device_context) const
noexcept

◆ BindBeginPostProcessing()

void mage::rendering::OutputManager::BindBeginPostProcessing ( ID3D11DeviceContext &  device_context) const
noexcept

◆ BindBeginResolve()

void mage::rendering::OutputManager::BindBeginResolve ( ID3D11DeviceContext &  device_context) const
noexcept

◆ BindBeginViewport()

void mage::rendering::OutputManager::BindBeginViewport ( ID3D11DeviceContext &  device_context) const
noexcept

◆ BindEnd()

void mage::rendering::OutputManager::BindEnd ( ID3D11DeviceContext &  device_context) const
noexcept

◆ BindEndDeferred()

void mage::rendering::OutputManager::BindEndDeferred ( ID3D11DeviceContext &  device_context) const
noexcept

◆ BindEndForward()

void mage::rendering::OutputManager::BindEndForward ( ID3D11DeviceContext &  device_context) const
noexcept

◆ BindEndGBuffer()

void mage::rendering::OutputManager::BindEndGBuffer ( ID3D11DeviceContext &  device_context) const
noexcept

◆ BindEndPostProcessing()

void mage::rendering::OutputManager::BindEndPostProcessing ( ID3D11DeviceContext &  device_context) const
noexcept

◆ BindEndResolve()

void mage::rendering::OutputManager::BindEndResolve ( ID3D11DeviceContext &  device_context) const
noexcept

◆ BindEndViewport()

void mage::rendering::OutputManager::BindEndViewport ( ID3D11DeviceContext &  device_context) const
noexcept

◆ BindGUI()

void mage::rendering::OutputManager::BindGUI ( ID3D11DeviceContext &  device_context) const
noexcept

◆ BindPingPong()

void mage::rendering::OutputManager::BindPingPong ( ID3D11DeviceContext &  device_context) const
noexcept

◆ GetRTV()

ID3D11RenderTargetView* mage::rendering::OutputManager::GetRTV ( RTVIndex  index) const
privatenoexcept

◆ GetSRV()

ID3D11ShaderResourceView* mage::rendering::OutputManager::GetSRV ( SRVIndex  index) const
privatenoexcept

◆ GetUAV()

ID3D11UnorderedAccessView* mage::rendering::OutputManager::GetUAV ( UAVIndex  index) const
privatenoexcept

◆ operator=() [1/2]

OutputManager& mage::rendering::OutputManager::operator= ( const OutputManager manager)
delete

Copies the given output manager to this output manager.

Parameters
[in]managerA reference to the output manager to copy.
Returns
A reference to the copy of the given output manager (i.e. this output manager).

◆ operator=() [2/2]

OutputManager & mage::rendering::OutputManager::operator= ( OutputManager &&  manager)
defaultnoexcept

Moves the given output manager to this output manager.

Parameters
[in]managerA reference to the output manager to move.
Returns
A reference to the moved output manager (i.e. this output manager).

◆ ReleaseAndGetAddressOfRTV()

NotNull< ID3D11RenderTargetView** > mage::rendering::OutputManager::ReleaseAndGetAddressOfRTV ( RTVIndex  index)
privatenoexcept

◆ ReleaseAndGetAddressOfSRV()

NotNull< ID3D11ShaderResourceView** > mage::rendering::OutputManager::ReleaseAndGetAddressOfSRV ( SRVIndex  index)
privatenoexcept

◆ ReleaseAndGetAddressOfUAV()

NotNull< ID3D11UnorderedAccessView** > mage::rendering::OutputManager::ReleaseAndGetAddressOfUAV ( UAVIndex  index)
privatenoexcept

◆ SetupBuffer()

void mage::rendering::OutputManager::SetupBuffer ( const U32x3 resolution,
DXGI_FORMAT  format,
ID3D11ShaderResourceView **  srv,
ID3D11RenderTargetView **  rtv,
ID3D11UnorderedAccessView **  uav 
)
private

◆ SetupBuffers()

void mage::rendering::OutputManager::SetupBuffers ( )
private

◆ SetupDepthBuffer()

void mage::rendering::OutputManager::SetupDepthBuffer ( const U32x3 resolution)
private

Member Data Documentation

◆ m_device

std::reference_wrapper< ID3D11Device > mage::rendering::OutputManager::m_device
private

◆ m_display_configuration

std::reference_wrapper< DisplayConfiguration > mage::rendering::OutputManager::m_display_configuration
private

◆ m_dsv

ComPtr< ID3D11DepthStencilView > mage::rendering::OutputManager::m_dsv
private

◆ m_hdr0_to_hdr1

bool mage::rendering::OutputManager::m_hdr0_to_hdr1
mutableprivate

◆ m_msaa

bool mage::rendering::OutputManager::m_msaa
private

◆ m_rtvs

ComPtr< ID3D11RenderTargetView > mage::rendering::OutputManager::m_rtvs[ static_cast< std::size_t >(RTVIndex::Count)]
private

◆ m_srvs

ComPtr< ID3D11ShaderResourceView > mage::rendering::OutputManager::m_srvs[ static_cast< std::size_t >(SRVIndex::Count)]
private

◆ m_ssaa

bool mage::rendering::OutputManager::m_ssaa
private

◆ m_swap_chain

std::reference_wrapper< SwapChain > mage::rendering::OutputManager::m_swap_chain
private

◆ m_uavs

ComPtr< ID3D11UnorderedAccessView > mage::rendering::OutputManager::m_uavs[ static_cast< std::size_t >(UAVIndex::Count)]
private