Class Sampler#

Inheritance Relationships#

Derived Type#

Class Documentation#

class Sampler#

Subclassed by TRAP::Graphics::API::VulkanSampler

Public Functions

virtual ~Sampler()#

Destructor.

consteval Sampler(const Sampler&) noexcept = delete#

Copy constructor.

consteval Sampler &operator=(const Sampler&) noexcept = delete#

Copy assignment operator.

constexpr Sampler(Sampler&&) noexcept = default#

Move constructor.

Sampler &operator=(Sampler&&) noexcept = default#

Move assignment operator.

constexpr FilterType GetMinFilter() const noexcept#

Retrieve the minification filter of the sampler.

Returns:

Minification filter.

constexpr FilterType GetMagFilter() const noexcept#

Retrieve the magnification filter of the sampler.

Returns:

Magnification filter.

constexpr MipMapMode GetMipMapMode() const noexcept#

Retrieve the mip map mode of the sampler.

Returns:

Mip map mode.

constexpr AddressMode GetAddressU() const noexcept#

Retrieve the address mode of the U coordinate of the sampler.

Returns:

Address mode.

constexpr AddressMode GetAddressV() const noexcept#

Retrieve the address mode of the V coordinate of the sampler.

Returns:

Address mode.

constexpr AddressMode GetAddressW() const noexcept#

Retrieve the address mode of the W coordinate of the sampler.

Returns:

Address mode.

constexpr f32 GetMipLodBias() const noexcept#

Retrieve the mip lod bias of the sampler.

Returns:

Address mode.

constexpr f32 GetAnisotropyLevel() const noexcept#

Retrieve the max anisotropy of the sampler.

Returns:

Max anisotropy.

constexpr CompareMode GetCompareFunc() const noexcept#

Retrieve the compare function of the sampler.

Returns:

Compare function.

constexpr bool UsesEngineAnisotropyLevel() const noexcept#

Retrieve whether the sampler uses the engines anisotropy level or not.

Returns:

True if engine set anisotropy level is used, false otherwise.

Public Static Functions

static TRAP::Ref<Sampler> Create(RendererAPI::SamplerDesc desc)#

Create a new sampler from the given description.

Parameters:

descSampler description.

Returns:

Created sampler.

static void ClearCache() noexcept#

Clear all cached samplers.

static void UpdateSamplers()#

Updates all samplers currently in use.

Warning

Only call this function between frames!

Protected Functions

explicit Sampler(const RendererAPI::SamplerDesc &desc)#

Constructor.

virtual void UpdateAnisotropy(f32 anisotropy) = 0#

Update the anisotropy value of the sampler.

Parameters:

anisotropy – New anisotropy to use.

Protected Attributes

RendererAPI::SamplerDesc m_samplerDesc = {}#
bool m_usesEngineAnisotropyLevel = false#