Nameless Engine
Loading...
Searching...
No Matches
ne::HlslGlobalShaderResourceBinding Class Reference

#include <HlslGlobalShaderResourceBinding.h>

Inheritance diagram for ne::HlslGlobalShaderResourceBinding:
ne::GlobalShaderResourceBinding

Protected Member Functions

 HlslGlobalShaderResourceBinding (GlobalShaderResourceBindingManager *pManager, const std::string &sShaderResourceName, const std::array< GpuResource *, FrameResourceManager::getFrameResourceCount()> &vResourcesToBind)
 
virtual std::optional< ErrorbindToPipelines (Pipeline *pSpecificPipeline) override
 
- Protected Member Functions inherited from ne::GlobalShaderResourceBinding
 GlobalShaderResourceBinding (GlobalShaderResourceBindingManager *pManager, const std::string &sShaderResourceName, const std::array< GpuResource *, FrameResourceManager::getFrameResourceCount()> &vResourcesToBind)
 
virtual std::optional< ErrorbindToPipelines (Pipeline *pSpecificPipeline)=0
 
void unregisterBinding ()
 
const std::string & getShaderResourceName () const
 
std::array< GpuResource *, FrameResourceManager::getFrameResourceCount()> getBindedResources () const
 

Friends

class GlobalShaderResourceBinding
 

Additional Inherited Members

- Public Member Functions inherited from ne::GlobalShaderResourceBinding
 GlobalShaderResourceBinding (const GlobalShaderResourceBinding &)=delete
 
GlobalShaderResourceBindingoperator= (const GlobalShaderResourceBinding &)=delete
 
 GlobalShaderResourceBinding (GlobalShaderResourceBinding &&)=delete
 
GlobalShaderResourceBindingoperator= (GlobalShaderResourceBinding &&)=delete
 
- Static Protected Member Functions inherited from ne::GlobalShaderResourceBinding
static std::optional< Errorcreate (Renderer *pRenderer, GlobalShaderResourceBindingManager *pManager, const std::string &sShaderResourceName, const std::array< GpuResource *, FrameResourceManager::getFrameResourceCount()> &vResourcesToBind)
 

Detailed Description

Used for binding GPU resources as "global" HLSL shader resources (that don't change on a per-object basis).

Constructor & Destructor Documentation

◆ HlslGlobalShaderResourceBinding()

ne::HlslGlobalShaderResourceBinding::HlslGlobalShaderResourceBinding ( GlobalShaderResourceBindingManager pManager,
const std::string &  sShaderResourceName,
const std::array< GpuResource *, FrameResourceManager::getFrameResourceCount()> &  vResourcesToBind 
)
protected

Initializes a new object, does not trigger bindToPipelines.

Parameters
pManagerManager that creates this object.
sShaderResourceNameName of the shader resource (name from shader code) to bind the resources.
vResourcesToBindResources to bind to pipelines. This can be the same resource for all frame resources (for example a texture) or a separate resource per frame (can be used for some CPU-write resources).

Member Function Documentation

◆ bindToPipelines()

std::optional< Error > ne::HlslGlobalShaderResourceBinding::bindToPipelines ( Pipeline pSpecificPipeline)
overrideprotectedvirtual

Binds the resource to a specific pipeline or all graphics pipelines that use it.

Parameters
pSpecificPipelinenullptr if need to bind to all graphics pipelines, otherwise a valid pointer to bind only to that pipeline.
Returns
Error if something went wrong.

Implements ne::GlobalShaderResourceBinding.


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