Nameless Engine
|
#include <ShaderResourceBinding.h>
Public Member Functions | |
virtual std::optional< Error > | changeUsedPipelines (const std::unordered_set< Pipeline * > &pipelinesToUse)=0 |
std::string | getShaderResourceName () const |
Protected Member Functions | |
ShaderResourceBindingBase (const std::string &sShaderResourceName) | |
virtual std::optional< Error > | onAfterAllPipelinesRefreshedResources ()=0 |
Private Attributes | |
const std::string | sShaderResourceName |
Friends | |
class | PipelineManager |
Base class for shader resource bindings.
|
protected |
Initializes the binding.
sShaderResourceName | Name of the resource we are referencing (should be exactly the same as the resource name written in the shader file we are referencing). |
|
pure virtual |
Called to make the resource to discard currently used pipelines and bind/reference other pipelines.
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).pipelinesToUse | Pipelines to use instead of the current ones. |
Implemented in ne::ShaderCpuWriteResourceBinding, ne::GlslShaderTextureResourceBinding, and ne::HlslShaderTextureResourceBinding.
std::string ne::ShaderResourceBindingBase::getShaderResourceName | ( | ) | const |
Returns name of the resource (from the shader code) that this binding references.
|
protectedpure virtual |
Called from the pipeline manager to notify that all pipelines released their internal resources and now restored them so their internal resources (for example push constants) might be different now and shader resource now needs to check that everything that it needs is still there and possibly re-bind to pipeline's descriptors since these might have been also re-created.
Implemented in ne::ShaderCpuWriteResourceBinding, ne::GlslShaderTextureResourceBinding, and ne::HlslShaderTextureResourceBinding.
|
private |
Name of the resource we are referencing (name in the shader code).