|
Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
|
Registry store for authored sampled 2D texture handles. More...
#include <AssetRegistry.h>
Classes | |
| struct | Record |
| Stored metadata for one 2D texture handle slot. More... | |
Public Member Functions | |
| Texture2DStore (AssetManager *assetManager=nullptr) | |
| Creates a 2D texture store backed by an optional asset manager. | |
| void | setAssetManager (AssetManager *assetManager) |
| Sets the asset manager used when new texture handles reserve legacy runtime handles. | |
| Assets::Texture2DHandle | load (const std::filesystem::path &source, Assets::TextureType usage=Assets::TextureType::BaseColor) |
| Gets or creates a stable handle for an authored 2D texture source path. | |
| bool | isValid (Assets::Texture2DHandle handle) const |
| Checks whether a texture handle refers to a live slot in this store. | |
| const std::filesystem::path * | sourcePath (Assets::Texture2DHandle handle) const |
| Returns the authored source path for a texture handle. | |
| Assets::TextureHandle | legacyHandle (Assets::Texture2DHandle handle) const |
| Returns the legacy runtime texture handle associated with a texture asset handle. | |
| Assets::TextureType | usage (Assets::Texture2DHandle handle) const |
| Returns the semantic usage recorded for a texture handle. | |
Static Private Member Functions | |
| static std::string | keyFor (const std::filesystem::path &source, Assets::TextureType usage) |
| Builds the deduplication key for a texture source path and usage. | |
Private Attributes | |
| AssetManager * | assetManager_ = nullptr |
| Optional bridge used to reserve legacy texture handles. | |
| std::vector< Record > | records_ |
| Slot storage indexed by Texture2DHandle::index. | |
| std::unordered_map< std::string, uint32_t > | sourceToIndex_ |
| Deduplication map from keyFor() to slot index. | |
Registry store for authored sampled 2D texture handles.
Texture2DStore maps source paths to stable Texture2DHandle values and records the requested texture usage plus the legacy runtime texture handle used by renderer descriptor lookup.
Definition at line 233 of file AssetRegistry.h.
|
explicit |
Creates a 2D texture store backed by an optional asset manager.
| assetManager | Asset manager used to reserve legacy texture handles, or nullptr for handle-only use. |
|
nodiscard |
Checks whether a texture handle refers to a live slot in this store.
| handle | Handle to validate. |
|
staticnodiscardprivate |
Builds the deduplication key for a texture source path and usage.
| source | Engine-relative texture source path. |
| usage | Semantic texture usage. |
References usage().
|
nodiscard |
Returns the legacy runtime texture handle associated with a texture asset handle.
| handle | Texture asset handle to look up. |
|
nodiscard |
Gets or creates a stable handle for an authored 2D texture source path.
| source | Engine-relative texture source path. |
| usage | Semantic texture usage requested for descriptor registration. |
References Engine::Assets::BaseColor, and usage().
| void Engine::Core::Texture2DStore::setAssetManager | ( | AssetManager * | assetManager | ) |
Sets the asset manager used when new texture handles reserve legacy runtime handles.
| assetManager | Asset manager to use, or nullptr to disable legacy handle reservation. |
|
nodiscard |
Returns the authored source path for a texture handle.
| handle | Handle to look up. |
|
nodiscard |
|
private |
Optional bridge used to reserve legacy texture handles.
Definition at line 306 of file AssetRegistry.h.
|
private |
Slot storage indexed by Texture2DHandle::index.
Definition at line 307 of file AssetRegistry.h.
|
private |
Deduplication map from keyFor() to slot index.
Definition at line 308 of file AssetRegistry.h.