Nameless Engine
Loading...
Searching...
No Matches
ne::DirectXPso::InternalResources Struct Reference

#include <DirectXPso.h>

Public Attributes

ComPtr< ID3D12RootSignature > pRootSignature
 
ComPtr< ID3D12PipelineState > pPso
 
std::unordered_map< std::string, UINT > rootParameterIndices
 
std::array< UINT, static_cast< unsigned int >(SpecialRootParameterSlot::SIZE)> vSpecialRootParameterIndices
 
std::unordered_map< UINT, std::array< DirectXResource *, FrameResourceManager::getFrameResourceCount()> > globalShaderResourceCbvs
 
std::unordered_map< UINT, std::array< DirectXResource *, FrameResourceManager::getFrameResourceCount()> > globalShaderResourceSrvs
 
std::unordered_map< UINT, std::shared_ptr< ContinuousDirectXDescriptorRange > > descriptorRangesToBind
 
bool bIsReadyForUsage = false
 

Detailed Description

Stores internal resources.

Member Data Documentation

◆ bIsReadyForUsage

bool ne::DirectXPso::InternalResources::bIsReadyForUsage = false

Whether fields of this struct are initialized or not.

◆ descriptorRangesToBind

std::unordered_map<UINT, std::shared_ptr<ContinuousDirectXDescriptorRange> > ne::DirectXPso::InternalResources::descriptorRangesToBind

Stores pairs of "root parameter index" - "descriptor range to bind".

Remarks
Shader resources modify this map.

◆ globalShaderResourceCbvs

std::unordered_map< UINT, std::array<DirectXResource*, FrameResourceManager::getFrameResourceCount()> > ne::DirectXPso::InternalResources::globalShaderResourceCbvs

Global bindings that should be bound as CBVs. Stores pairs of "root parameter index" - "resource to bind".

Remarks
It's safe to store raw pointers to resources here because the resources must be valid white they are used in the pipeline (so when a pipeline is no longer used it's destroyed and thus this array will be empty) but when the pipeline recreates its internal resources to apply some changes it clears this array and expects the resources to be rebound.

◆ globalShaderResourceSrvs

std::unordered_map< UINT, std::array<DirectXResource*, FrameResourceManager::getFrameResourceCount()> > ne::DirectXPso::InternalResources::globalShaderResourceSrvs

Global bindings that should be bound as SRVs. Stores pairs of "root parameter index" - "resource to bind".

Remarks
See globalShaderResourceCbvs on why it's safe to store raw pointers here.

◆ pPso

ComPtr<ID3D12PipelineState> ne::DirectXPso::InternalResources::pPso

Created PSO.

◆ pRootSignature

ComPtr<ID3D12RootSignature> ne::DirectXPso::InternalResources::pRootSignature

Root signature, used in PSO.

◆ rootParameterIndices

std::unordered_map<std::string, UINT> ne::DirectXPso::InternalResources::rootParameterIndices

Root parameter indices that was used in creation of pRootSignature.

Stores pairs of shader resource name - root parameter index, allows determining which resource is binded to which root parameter index (by using resource name taken from shader file).

◆ vSpecialRootParameterIndices

std::array<UINT, static_cast<unsigned int>(SpecialRootParameterSlot::SIZE)> ne::DirectXPso::InternalResources::vSpecialRootParameterIndices

Stores indices of some non-user specified root parameters. Duplicates some root parameters and their indices from rootParameterIndices but only stored some special non-user specified root parameter indices.

Remarks
Generally used for fast access (without doing a find in the map) to some root parameter indices.
Example usage: iRootParameterIndex = vIndices[Slot::FRAME_DATA].

The documentation for this struct was generated from the following file: