Nameless Engine
|
#include <DirectXPso.h>
Classes | |
struct | InternalResources |
Public Member Functions | |
DirectXPso (const DirectXPso &)=delete | |
DirectXPso & | operator= (const DirectXPso &)=delete |
std::variant< unsigned int, Error > | getRootParameterIndex (const std::string &sShaderResourceName) |
std::pair< std::recursive_mutex, InternalResources > * | getInternalResources () |
Public Member Functions inherited from ne::Pipeline | |
Pipeline (const Pipeline &)=delete | |
Pipeline & | operator= (const Pipeline &)=delete |
std::variant< size_t, Error > | getUintConstantOffset (const std::string &sConstantName) |
std::pair< std::mutex, std::unordered_set< Material * > > * | getMaterialsThatUseThisPipeline () |
std::string | getPipelineIdentifier () const |
Renderer * | getRenderer () const |
const PipelineConfiguration * | getConfiguration () const |
std::pair< std::mutex, std::optional< ShaderConstantsData > > * | getShaderConstants () |
Public Member Functions inherited from ne::ShaderUser | |
ShaderUser (const ShaderUser &)=delete | |
ShaderUser & | operator= (const ShaderUser &)=delete |
Static Public Member Functions | |
static std::variant< std::shared_ptr< DirectXPso >, Error > | createGraphicsPso (Renderer *pRenderer, PipelineManager *pPipelineManager, std::unique_ptr< PipelineConfiguration > pPipelineConfiguration) |
static std::variant< std::shared_ptr< DirectXPso >, Error > | createComputePso (Renderer *pRenderer, PipelineManager *pPipelineManager, const std::string &sComputeShaderName) |
Static Public Member Functions inherited from ne::Pipeline | |
static std::string | combineShaderNames (std::string_view sVertexShaderName, std::string_view sPixelShaderName, std::string_view sComputeShaderName="") |
Protected Member Functions | |
virtual std::optional< Error > | releaseInternalResources () override |
virtual std::optional< Error > | restoreInternalResources () override |
Protected Member Functions inherited from ne::Pipeline | |
Pipeline (Renderer *pRenderer, PipelineManager *pPipelineManager, std::unique_ptr< PipelineConfiguration > pPipelineConfiguration) | |
virtual std::optional< Error > | releaseInternalResources ()=0 |
virtual std::optional< Error > | restoreInternalResources ()=0 |
void | setShaderConstants (const std::unordered_map< std::string, size_t > &uintConstantsOffsets) |
Protected Member Functions inherited from ne::ShaderUser | |
ShaderUser (ShaderManager *pShaderManager) | |
virtual | ~ShaderUser () |
bool | addShader (const std::string &sShaderName) |
ShaderPack * | findShader (ShaderType shaderType) |
Private Member Functions | |
DirectXPso (Renderer *pRenderer, PipelineManager *pPipelineManager, std::unique_ptr< PipelineConfiguration > pPipelineConfiguration) | |
void | bindGlobalShaderResourceViews (const ComPtr< ID3D12GraphicsCommandList > &pCommandList, size_t iCurrentFrameResourceIndex) const |
std::optional< Error > | generateGraphicsPso () |
std::optional< Error > | generateComputePso () |
Private Attributes | |
std::pair< std::recursive_mutex, InternalResources > | mtxInternalResources |
Friends | |
class | DirectXRenderer |
DirectX pipeline state object (PSO) wrapper.
|
explicitprivate |
Constructs uninitialized pipeline.
pRenderer | Used renderer. |
pPipelineManager | Pipeline manager that owns this PSO. |
pPipelineConfiguration | Settings and usage details. |
|
inlineprivate |
Sets views of global shader resource bindings.
pCommandList | Command list to set views to. |
iCurrentFrameResourceIndex | Index of the frame resource that is currently being used to submit a new frame. |
|
static |
Assigns compute shader to create a compute PSO.
pRenderer | Used renderer. |
pPipelineManager | Pipeline manager that owns this PSO. |
sComputeShaderName | Name of the compiled compute shader (see ShaderManager::compileShaders). |
|
static |
Assigns vertex and pixel shaders to create a graphics PSO (for usual rendering).
pRenderer | Used renderer. |
pPipelineManager | Pipeline manager that owns this PSO. |
pPipelineConfiguration | Settings that determine pipeline usage and usage details. |
|
private |
(Re)generates DirectX compute pipeline state object.
|
private |
(Re)generates DirectX graphics pipeline state object.
|
inline |
Returns internal resources that this PSO uses.
std::variant< unsigned int, Error > ne::DirectXPso::getRootParameterIndex | ( | const std::string & | sShaderResourceName | ) |
|
overrideprotectedvirtual |
Releases internal resources such as root signature or descriptor layout, internal pipeline object and etc.
Implements ne::Pipeline.
|
overrideprotectedvirtual |
Creates internal resources using the current shader configuration.
Implements ne::Pipeline.
|
private |
Internal resources. Must be used with mutex when changing.