Nameless Engine
|
#include <HlslGlobalShaderResourceBinding.h>
Protected Member Functions | |
HlslGlobalShaderResourceBinding (GlobalShaderResourceBindingManager *pManager, const std::string &sShaderResourceName, const std::array< GpuResource *, FrameResourceManager::getFrameResourceCount()> &vResourcesToBind) | |
virtual std::optional< Error > | bindToPipelines (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< Error > | bindToPipelines (Pipeline *pSpecificPipeline)=0 |
void | unregisterBinding () |
const std::string & | getShaderResourceName () const |
std::array< GpuResource *, FrameResourceManager::getFrameResourceCount()> | getBindedResources () const |
Static Private Member Functions | |
static std::optional< Error > | bindResourceToGraphicsPipelines (PipelineManager *pPipelineManager, const std::function< std::optional< Error >(Pipeline *pPipeline)> &onBind) |
static std::optional< Error > | bindResourcesToPipeline (const std::array< DirectXResource *, FrameResourceManager::getFrameResourceCount()> &vResourcesToBind, DirectXDescriptorType bindingType, Pipeline *pPipeline, const std::string &sShaderResourceName) |
Friends | |
class | GlobalShaderResourceBinding |
Additional Inherited Members | |
Public Member Functions inherited from ne::GlobalShaderResourceBinding | |
GlobalShaderResourceBinding (const GlobalShaderResourceBinding &)=delete | |
GlobalShaderResourceBinding & | operator= (const GlobalShaderResourceBinding &)=delete |
GlobalShaderResourceBinding (GlobalShaderResourceBinding &&)=delete | |
GlobalShaderResourceBinding & | operator= (GlobalShaderResourceBinding &&)=delete |
Static Protected Member Functions inherited from ne::GlobalShaderResourceBinding | |
static std::optional< Error > | create (Renderer *pRenderer, GlobalShaderResourceBindingManager *pManager, const std::string &sShaderResourceName, const std::array< GpuResource *, FrameResourceManager::getFrameResourceCount()> &vResourcesToBind) |
Used for binding GPU resources as "global" HLSL shader resources (that don't change on a per-object basis).
|
protected |
Initializes a new object, does not trigger bindToPipelines.
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). |
|
staticprivate |
Binds the specified resources to the specified pipeline as a global SRV binding.
vResourcesToBind | Resource per frame to bind. |
bindingType | Type of the binding to create. |
pPipeline | Pipeline to bind to. |
sShaderResourceName | Name of the shader resource to bind to. |
|
staticprivate |
Specify a callback that will be called for each graphics pipeline to bind your resource.
pPipelineManager | Manager to query graphics pipelines. |
onBind | Called on each pipeline. |
|
overrideprotectedvirtual |
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. |
Implements ne::GlobalShaderResourceBinding.