Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Private Member Functions | Private Attributes | List of all members
SamplerLibrary Class Reference

Manage all samplers for GPU textures. Samplers are shared between all shader programs, and directly specified in the shaders based on use. All samplers are stored in a unique, shared descriptor set appended to all other sets (set #3). More...

#include <SamplerLibrary.hpp>

Classes

struct  SamplerSettings
 Sampler parameters. More...
 

Public Member Functions

void init ()
 
void clean ()
 
VkDescriptorSetLayout getLayout () const
 
VkDescriptorSet getSetHandle () const
 
VkSampler getDefaultSampler () const
 

Static Private Member Functions

static VkSampler setupSampler (const SamplerSettings &settings)
 

Private Attributes

std::vector< VkSampler > _samplers
 Texture samplers.
 
VkDescriptorSetLayout _layout
 Samplers descriptor set layout.
 
DescriptorSet _set
 Samplers descriptor set allocation.
 

Detailed Description

Manage all samplers for GPU textures. Samplers are shared between all shader programs, and directly specified in the shaders based on use. All samplers are stored in a unique, shared descriptor set appended to all other sets (set #3).

See also
GPUShaders::Common::Samplers

Member Function Documentation

◆ clean()

void SamplerLibrary::clean ( )

Clean all samplers

◆ getDefaultSampler()

VkSampler SamplerLibrary::getDefaultSampler ( ) const
inline
Returns
a basic sampler for use when displaying textures in ImGui
Note
It is a linearly interpolated sampler with clamped UVs (sClampLinear)

◆ getLayout()

VkDescriptorSetLayout SamplerLibrary::getLayout ( ) const
inline
Returns
the sampler descriptor set layout

◆ getSetHandle()

VkDescriptorSet SamplerLibrary::getSetHandle ( ) const
inline
Returns
the sampler descriptor set

◆ init()

void SamplerLibrary::init ( )

Initialize the samplers.

◆ setupSampler()

VkSampler SamplerLibrary::setupSampler ( const SamplerSettings settings)
staticprivate

Create a sampler based on the sampling parameters.

Parameters
settingsthe sampler configuration
Returns
the created sampler

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