Rendu
A lightweight rendering engine for experimentations
Loading...
Searching...
No Matches
SamplerLibrary.hpp
1#pragma once
2
3#include "Common.hpp"
4#include "graphics/GPUTypes.hpp"
5#include "graphics/GPUObjects.hpp"
6
7
14public:
15
17 void init();
18
20 void clean();
21
23 VkDescriptorSetLayout getLayout() const { return _layout; }
24
26 VkDescriptorSet getSetHandle() const { return _set.handle; }
27
31 VkSampler getDefaultSampler() const { return _samplers[2]; }
32
33private:
34
37 std::string name;
40 bool useLods;
42 };
43
48 static VkSampler setupSampler(const SamplerSettings & settings);
49
50 std::vector<VkSampler> _samplers;
51 VkDescriptorSetLayout _layout;
53};
Manage all samplers for GPU textures. Samplers are shared between all shader programs,...
Definition: SamplerLibrary.hpp:13
VkDescriptorSet getSetHandle() const
Definition: SamplerLibrary.hpp:26
VkDescriptorSetLayout _layout
Samplers descriptor set layout.
Definition: SamplerLibrary.hpp:51
VkSampler getDefaultSampler() const
Definition: SamplerLibrary.hpp:31
void clean()
Definition: SamplerLibrary.cpp:64
VkDescriptorSetLayout getLayout() const
Definition: SamplerLibrary.hpp:23
std::vector< VkSampler > _samplers
Texture samplers.
Definition: SamplerLibrary.hpp:50
void init()
Definition: SamplerLibrary.cpp:7
static VkSampler setupSampler(const SamplerSettings &settings)
Definition: SamplerLibrary.cpp:73
DescriptorSet _set
Samplers descriptor set allocation.
Definition: SamplerLibrary.hpp:52
Filter
The filtering mode of a texture: we deduce the magnification filter from the minification filter for ...
Definition: GPUTypes.hpp:198
Wrap
The wrapping mode of a texture.
Definition: GPUTypes.hpp:213
Descriptor set allocation.
Definition: GPUTypes.hpp:508
VkDescriptorSet handle
The native handle.
Definition: GPUTypes.hpp:509
Sampler parameters.
Definition: SamplerLibrary.hpp:36
bool anisotropy
Use anisotropy.
Definition: SamplerLibrary.hpp:41
Wrap wrapping
Adress wrapping.
Definition: SamplerLibrary.hpp:39
Filter filter
Min/mag/mip filtering.
Definition: SamplerLibrary.hpp:38
std::string name
Sampler debug name.
Definition: SamplerLibrary.hpp:37
bool useLods
Use mip LODs.
Definition: SamplerLibrary.hpp:40