ezEngine Release 25.08
Loading...
Searching...
No Matches
ezGALImmutableSamplers Class Reference

Manages and creates immutable samplers. Once registered, the immutable sampler will be automatically be bound to a shader and can't be changed at runtime. Besides convenience of not having to set these in code, GAL implementations like Vulkan can use this to optimize resource binding. Immutable samplers should be registered at Core Startup via a subsystem, see ezRenderContext::RegisterImmutableSamplers for example. There is no unregister, these samples are immutable after all. The list is cleared on Core Shutdown. More...

#include <ImmutableSamplers.h>

Public Types

using ImmutableSamplers = ezHashTable< ezHashedString, ezGALSamplerStateHandle >
 

Static Public Member Functions

static ezResult RegisterImmutableSampler (ezHashedString sSamplerName, const ezGALSamplerStateCreationDescription &desc)
 
static const ImmutableSamplersGetImmutableSamplers ()
 

Detailed Description

Manages and creates immutable samplers. Once registered, the immutable sampler will be automatically be bound to a shader and can't be changed at runtime. Besides convenience of not having to set these in code, GAL implementations like Vulkan can use this to optimize resource binding. Immutable samplers should be registered at Core Startup via a subsystem, see ezRenderContext::RegisterImmutableSamplers for example. There is no unregister, these samples are immutable after all. The list is cleared on Core Shutdown.

Member Function Documentation

◆ GetImmutableSamplers()

const ezGALImmutableSamplers::ImmutableSamplers & ezGALImmutableSamplers::GetImmutableSamplers ( )
static

Returns the table of immutable samplers. Only valid to call after GAL device init.

Returns
Table of sampler name to sampler handle.

◆ RegisterImmutableSampler()

ezResult ezGALImmutableSamplers::RegisterImmutableSampler ( ezHashedString  sSamplerName,
const ezGALSamplerStateCreationDescription desc 
)
static

Registers an immutable sampler. Should be called during Core Startup via a subsystem.

Parameters
sSamplerNameThe shader resource name of the sampler to be added.
descThe description of the sampler. It will be created on GAL device init.
Returns
Returns success if the sampler was not already registered.

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