Nameless Engine
|
#include <GlobalShaderResourceBinding.h>
Public Member Functions | |
GlobalShaderResourceBinding (const GlobalShaderResourceBinding &)=delete | |
GlobalShaderResourceBinding & | operator= (const GlobalShaderResourceBinding &)=delete |
GlobalShaderResourceBinding (GlobalShaderResourceBinding &&)=delete | |
GlobalShaderResourceBinding & | operator= (GlobalShaderResourceBinding &&)=delete |
Protected Member Functions | |
GlobalShaderResourceBinding (GlobalShaderResourceBindingManager *pManager, const std::string &sShaderResourceName, const std::array< GpuResource *, FrameResourceManager::getFrameResourceCount()> &vResourcesToBind) | |
virtual std::optional< Error > | bindToPipelines (Pipeline *pSpecificPipeline)=0 |
void | unregisterBinding () |
const std::string & | getShaderResourceName () const |
std::array< GpuResource *, FrameResourceManager::getFrameResourceCount()> | getBindedResources () const |
Static Protected Member Functions | |
static std::optional< Error > | create (Renderer *pRenderer, GlobalShaderResourceBindingManager *pManager, const std::string &sShaderResourceName, const std::array< GpuResource *, FrameResourceManager::getFrameResourceCount()> &vResourcesToBind) |
Private Attributes | |
const std::string | sShaderResourceName |
const std::array< GpuResource *, FrameResourceManager::getFrameResourceCount()> | vBindedResources |
GlobalShaderResourceBindingManager *const | pManager = nullptr |
Friends | |
class | GlobalShaderResourceBindingManager |
RAII-style type that:
Used for binding GPU resources as "global" shader resources (that don't change on a per-object basis).
|
protected |
Initializes base entity (derived types will do the binding logic).
pManager | Manager that creates this object. |
sShaderResourceName | Name of the shader resource (name from shader code) to bind the resources. |
vResourcesToBind | Resources 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). |
|
protectedpure virtual |
Binds the resource to a specific pipeline or all graphics pipelines that use it.
pSpecificPipeline | nullptr if need to bind to all graphics pipelines, otherwise a valid pointer to bind only to that pipeline. |
Implemented in ne::GlslGlobalShaderResourceBinding, and ne::HlslGlobalShaderResourceBinding.
|
staticprotected |
Creates a new render-specific binding and registers it in the manager. Also assigns this new binding to the specified GPU resource so that the binding will be removed once the resources are destroyed.
pRenderer | Renderer. |
sShaderResourceName | Name of the shader resource (name from shader code) to bind the resources. |
pManager | Manager that creates this object. |
vResourcesToBind | Resources 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). |
|
protected |
Returns GPU resources that should be binded.
|
protected |
Returns name of the shader resource (name from shader code) to bind to.
|
protected |
Should be called by derived types in their destructor to unregister the binding in the manager.
|
private |
Manager that created this object.
|
private |
Name of the shader resource (name from shader code) to bind vBindedResources to.
|
private |
Resources binded to pipelines.