![]() |
VPP
0.7
A high-level modern C++ API for Vulkan
|
Sampler binding point. More...
#include <vppLangIntImages.hpp>
Public Member Functions | |
inSampler (unsigned int set=0, int binding=-1) | |
Creates the binding point. More... | |
auto | operator= (const SamplerT &value) |
Binds a sampler object to the binding point. More... | |
Sampler binding point.
Place inside your custom PipelineConfig (or ComputePipelineConfig) derived class to define a binding point for texture sampler. This sampler can be asociated with a texture by means of MakeSampledTexture() function.
In this variant, the sampler is bound dynamically at runtime to a shader data block. Use the assignment operator for that. Provide a vpp::NormalizedSampler or vpp::UnnormalizedSampler object. The sampler can be changed later by binding a different sampler.
vpp::inSampler< SamplerT >::inSampler | ( | unsigned int | set = 0 , |
int | binding = -1 |
||
) |
Creates the binding point.
Typically you do not need to specify any arguments for the constructor.
Optionally you can force the set and binding index. This feature may be useful if you need to interface VPP binding point with externally supplied shader (written in GLSL and compiled externally to SPIR-V blob).
auto vpp::inSampler< SamplerT >::operator= | ( | const SamplerT & | value | ) |
Binds a sampler object to the binding point.
This operator returns a value that must be passed to ShaderDataBlock::update() method. You can also make a list of more assignments, joining them with comma operator. The update method accepts such a list.
The binding is stored inside ShaderDataBlock instance, immediately when update
is called. You select active ShaderDataBlock in your drawing command sequence by calling ShaderDataBlock::cmdBind(). Thus, actual resource binding (to the pipeline) occurs at command execution time, simultaneously for all bindings in that ShaderDataBlock instance.
Provide a vpp::NormalizedSampler or vpp::UnnormalizedSampler object as the argument. The sampler can be changed later by binding a different sampler.