Cache for sampler objects. More...
#include <kanzi/core.ui/graphics/sampler_cache.hpp>
Public Types | |
| using | storage_type |
| Storage type. | |
Public Member Functions | |
| gfx::SamplerHandleGuard | get (const Sampler::CreateInfo &createInfo, string_view name) |
| Gets or creates a sampler based on given settings. | |
| void | invalidate () |
| Invalidates the cache and releases all kanzi graphics handles. | |
| SamplerCache & | operator= (const SamplerCache &)=delete |
| Deleted copy operator. | |
| SamplerCache & | operator= (SamplerCache &&)=delete |
| Deleted move operator. | |
| SamplerCache ()=default | |
| Default constructor. | |
| SamplerCache (const SamplerCache &)=delete | |
| Deleted copy constructor. | |
| SamplerCache (SamplerCache &&)=delete | |
| Deleted move constructor. | |
Protected Attributes | |
| storage_type | m_samplers |
| Sampler storage. | |
Cache for sampler objects.
Intended for caching variations of samplers made from default texture samplers and reducing number of of total samplers created.
Storage type.
|
explicitdefault |
Default constructor.
|
delete |
Deleted copy constructor.
|
delete |
Deleted move constructor.
|
delete |
Deleted copy operator.
|
delete |
Deleted move operator.
| gfx::SamplerHandleGuard kanzi::SamplerCache::get | ( | const Sampler::CreateInfo & | createInfo, |
| string_view | name ) |
Gets or creates a sampler based on given settings.
Sampler::CreateInfo is a packed structure, so the comparison is quite fast. This function can be called during rendering to acquire an alternative sampler without worrying about performance.
| createInfo | Sampler create info. |
| name | Name to use for the sampler if it has to be generated. |
| void kanzi::SamplerCache::invalidate | ( | ) |
Invalidates the cache and releases all kanzi graphics handles.
|
protected |
Sampler storage.