Nameless Engine
Loading...
Searching...
No Matches
ne::ShaderTextureResourceBinding Class Referenceabstract

#include <ShaderResourceBinding.h>

Inheritance diagram for ne::ShaderTextureResourceBinding:
ne::ShaderResourceBindingBase ne::GlslShaderTextureResourceBinding ne::HlslShaderTextureResourceBinding

Public Member Functions

virtual std::optional< ErroruseNewTexture (std::unique_ptr< TextureHandle > pTextureToUse)=0
 
- Public Member Functions inherited from ne::ShaderResourceBindingBase
virtual std::optional< ErrorchangeUsedPipelines (const std::unordered_set< Pipeline * > &pipelinesToUse)=0
 
std::string getShaderResourceName () const
 

Protected Member Functions

 ShaderTextureResourceBinding (const std::string &sShaderResourceName)
 
- Protected Member Functions inherited from ne::ShaderResourceBindingBase
 ShaderResourceBindingBase (const std::string &sShaderResourceName)
 
virtual std::optional< ErroronAfterAllPipelinesRefreshedResources ()=0
 

Detailed Description

References some texture from shader code (can also a single texture in the array of textures).

Constructor & Destructor Documentation

◆ ShaderTextureResourceBinding()

ne::ShaderTextureResourceBinding::ShaderTextureResourceBinding ( const std::string &  sShaderResourceName)
protected

Initializes the binding.

Parameters
sShaderResourceNameName of the resource we are referencing (should be exactly the same as the resource name written in the shader file we are referencing).

Member Function Documentation

◆ useNewTexture()

virtual std::optional< Error > ne::ShaderTextureResourceBinding::useNewTexture ( std::unique_ptr< TextureHandle pTextureToUse)
pure virtual

Makes the binding to reference the new (specified) texture.

Warning
Expects that the caller is using some mutex to protect this binding from being used in the draw function while this function is not finished (i.e. make sure the CPU will not queue a new frame while this function is not finished).
Parameters
pTextureToUseTexture to reference.
Returns
Error if something went wrong.

Implemented in ne::GlslShaderTextureResourceBinding, and ne::HlslShaderTextureResourceBinding.


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