VPP  0.8
A high-level modern C++ API for Vulkan
vpp::inSampler< SamplerT > Class Template Reference

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...
 

Detailed Description

template<class SamplerT>
class vpp::inSampler< SamplerT >

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.

Constructor & Destructor Documentation

◆ inSampler()

template<class SamplerT>
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).

Member Function Documentation

◆ operator=()

template<class SamplerT>
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.


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