Plasma Engine  2.0
Loading...
Searching...
No Matches
plGALImmutableSamplers 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 plRenderContext::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 = plHashTable<plHashedString, plGALSamplerStateHandle>
 

Static Public Member Functions

static plResult RegisterImmutableSampler (plHashedString sSamplerName, const plGALSamplerStateCreationDescription &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 plRenderContext::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 plGALImmutableSamplers::ImmutableSamplers & plGALImmutableSamplers::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()

plResult plGALImmutableSamplers::RegisterImmutableSampler ( plHashedString sSamplerName,
const plGALSamplerStateCreationDescription & 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: