Vulkan Schnee 0.0.1 (22840dc8)
High-performance rendering engine
Loading...
Searching...
No Matches
Engine::Core::AssetManager Class Reference

Coordinates engine asset loading pipelines and runtime texture descriptor ownership. More...

#include <AssetManager.h>

Collaboration diagram for Engine::Core::AssetManager:

Public Types

using AudioAssetRef = Assets::AudioAssetRef
 Legacy asset reference type for audio assets.
using AnimationAssetRef = Assets::AnimationAssetRef
 Legacy asset reference type for animation assets.
using MaterialAssetRef = Assets::MaterialAssetRef
 Legacy asset reference type for material assets.
using MeshAssetRef = Assets::MeshAssetRef
 Legacy asset reference type for mesh assets.
using SkinAssetRef = Assets::SkinAssetRef
 Legacy asset reference type for skin assets.
using TextureAssetRef = Assets::TextureAssetRef
 Legacy asset reference type for texture assets.

Public Member Functions

template<typename AssetClass, typename Key>
auto getAsset (const Key &asset)
 Gets or creates an asset reference and requests loading when needed.
 AssetManager ()
 Creates an asset manager without an application context.
 AssetManager (ApplicationContext *context)
 Creates an asset manager bound to an application context.
 ~AssetManager ()
 Destroys owned asset managers and worker pools.
void attachToRenderer (Rendering::Renderer *renderer)
 Attaches the renderer used for texture uploads and descriptor reservation notifications.
void setRenderingDataManager (RenderingDataManager *renderingDataManager)
 Sets the rendering data manager used by asset pipelines.
Assets::CubemapTexture * loadEcsCubemap (const std::filesystem::path &path)
 Loads a six-face cubemap asset from a directory.
uint32_t getTextureDescriptorIndex (const std::filesystem::path &path)
 Gets the descriptor index of a resident texture by path.
uint32_t getTextureDescriptorIndex (const std::filesystem::path &path, Assets::TextureType type)
 Gets the descriptor index of a resident texture by path and semantic type.
Assets::TextureHandle getOrCreateTextureHandleWithSlot (const std::filesystem::path &path, Assets::TextureType type)
 Gets or creates a texture handle and reserves a stable descriptor slot for it.
template<Assets::TextureType Type>
Assets::TypedTextureHandle< Type > getOrCreateTextureHandleWithSlot (const std::filesystem::path &path)
 Gets or creates a typed texture handle and reserves a stable descriptor slot for it.
uint32_t getImageCount () const
 Gets the number of registered runtime texture identities.
void cleanup ()
 Waits for asset jobs and releases loaded runtime texture resources.
std::vector< VkDescriptorImageInfo > getTextureDescriptorInfos () const
 Builds descriptor image info records for resident textures.
Ecs::AssetImportPipeline & getAssetImportPipeline ()
 Gets the master asset import pipeline.
Ecs::TextureAssetPipeline & getTextureAssetPipeline ()
 Gets the texture loading pipeline.
Ecs::ModelAssetPipeline & getMeshAssetPipeline ()
 Gets the glTF model loading pipeline.
Ecs::AudioAssetPipeline & getAudioAssetPipeline ()
 Gets the audio loading pipeline.
void unloadAllData ()
 Discards pending work and clears loaded asset manager state.
void discardSceneLoadingData ()
 Drops queued or in-flight scene asset loading work.
AudioAssetRef loadAudioAsset (const Asset::Path &path)
 Submits an audio file for async loading through the audio pipeline.
Assets::Audio * getAudioAsset (const Asset::Path &path)
 Gets a loaded audio asset by path.
Assets::AudioAssetManager * getAudioAssetManager () const
 Gets the audio asset manager for direct access.
Assets::MaterialAssetManager * getMaterialAssetManager () const
 Gets the material asset manager for material lookups.
Assets::ModelAssetManager * getModelAssetManager () const
 Gets the model asset manager for model and glTF loading state lookups.
Assets::MeshAssetManager * getMeshAssetManager () const
 Gets the mesh asset manager for mesh asset lookups.
Assets::SkinAssetManager * getSkinAssetManager () const
 Gets the skin asset manager for direct access.
Assets::AnimationAssetManager * getAnimationAssetManager () const
 Gets the animation asset manager for direct access.
Assets::Textures::TextureHandleRegistry * getTextureHandleRegistry ()
 Gets the texture handle registry for O(1) descriptor index lookups.
Assets::RuntimeTextureDescriptorLease reserveRuntimeTextureDescriptor ()
 Reserves a stable descriptor index for a runtime-generated sampled image.
NamedThreadPool * getCalculationPool () const
 Gets the worker pool used for asset-side CPU calculations.
NamedThreadPool * getAssetLoaderPool () const
 Gets the worker pool used for asynchronous asset loading.

Private Member Functions

void loadEcsModel (const std::filesystem::path &path)
 Submits a glTF model file for asynchronous loading.
void loadEcsTexture (const std::filesystem::path &path)
 Submits a texture file for asynchronous loading.
Assets::Mesh * getMeshAsset (const Asset::MeshPath &asset)
 Gets a mesh asset by path or requests its model if it is not loaded.
void releaseRuntimeTextureDescriptorIndex (uint32_t descriptorIndex)
bool doesTextureAlreadyExist (const std::filesystem::path &path)
 Checks whether a texture path has a loaded identity entry.
Assets::RuntimeTexture * registerTexture (const std::filesystem::path &path, Assets::RuntimeTexture texture)
 Creates Vulkan resources for a texture and registers it as file-backed texture data.
Assets::RuntimeTexture * registerTexture (const std::filesystem::path &path, Assets::TextureType type, Assets::RuntimeTexture texture)
 Creates Vulkan resources for a typed texture and registers it as file-backed texture data.
Assets::RuntimeTexture * registerTextureFromPrepared (const std::filesystem::path &path, Assets::RuntimeTexture texture)
 Registers a texture whose Vulkan resources are already created.
Assets::RuntimeTexture * registerTextureFromPrepared (const std::filesystem::path &path, Assets::TextureType type, Assets::RuntimeTexture texture)
 Registers a typed texture whose Vulkan resources are already created.
Assets::RuntimeTexture * replaceTextureFromPrepared (const std::filesystem::path &path, Assets::RuntimeTexture texture)
 Replaces an already registered texture while preserving its descriptor index.
Assets::RuntimeTexture * replaceTextureFromPrepared (const std::filesystem::path &path, Assets::TextureType type, Assets::RuntimeTexture texture)
 Replaces an already registered typed texture while preserving its descriptor index.
void unregisterTexture (Assets::RuntimeTexture *texture)
 Unregisters a runtime texture and clears its descriptor slot.
void unloadRuntimeTextures ()
 Releases all runtime texture data and descriptor reservations owned by this manager.
void ensureFallbackTextureLocked ()
 Creates the built-in fallback texture when it does not already exist.

Private Attributes

friend ApplicationContext
friend RenderingDataManager
NamedThreadPool * threadPool_ = nullptr
NamedThreadPool * threadedCalculation_ = nullptr
Assets::TextureAssetManager * textureAssetManager
Assets::MeshAssetManager * meshAssetManager
Assets::MaterialAssetManager * materialAssetManager
Assets::ModelAssetManager * modelAssetManager
Assets::SkinAssetManager * skinAssetManager_
Assets::AnimationAssetManager * animationAssetManager_
Assets::Textures::TextureHandleRegistry textureHandleRegistry_
 Registry for type-safe texture handles.
Assets::AudioAssetManager * audioAssetManager_
Ecs::AssetImportPipeline assetImportPipeline
Assets::Loaders::GltfLoader gltfLoader = Assets::Loaders::GltfLoader( threadPool_ )
ApplicationContext * context = nullptr
Rendering::Renderer * renderer = nullptr
std::unordered_map< Assets::Textures::TextureIdentityKey, Assets::RuntimeTexture *, Assets::Textures::TextureIdentityKeyHash > textures = {}
std::unordered_map< std::string, std::vector< Assets::Textures::TextureIdentityKey > > textureIdentitiesByPath_
std::unordered_map< std::filesystem::path, std::unique_ptr< Assets::CubemapTexture >, PathHasher > cubemapTextures = {}
BidirectionalMap< uint32_t, Assets::RuntimeTexture * > textureIndexMap
std::array< std::optional< Assets::RuntimeTexture >, MAX_TEXTURE_COUNT > textureData
DescriptorIndexAllocator textureAllocator
std::unordered_set< uint32_t > runtimeTextureDescriptorIndices_
std::unordered_set< uint32_t > fileTextureDescriptorIndices_
uint32_t fallbackTextureDescriptorIndex_ = Assets::TextureHandle::INVALID_ID
std::mutex textureMutex
std::vector< TextureStorage > texturesToUpload {}
std::vector< Assets::RuntimeTexture * > texturesToCopyImageData

Detailed Description

Coordinates engine asset loading pipelines and runtime texture descriptor ownership.

AssetManager owns the high-level mesh, material, texture, skin, animation, and audio managers used by the renderer and scene loading code. It submits asynchronous load work, exposes stable asset refs, and keeps descriptor indices for loaded or runtime-generated textures.

Definition at line 193 of file AssetManager.h.

Member Typedef Documentation

◆ AnimationAssetRef

Legacy asset reference type for animation assets.

Definition at line 204 of file AssetManager.h.

◆ AudioAssetRef

Legacy asset reference type for audio assets.

Definition at line 202 of file AssetManager.h.

◆ MaterialAssetRef

Legacy asset reference type for material assets.

Definition at line 206 of file AssetManager.h.

◆ MeshAssetRef

Legacy asset reference type for mesh assets.

Definition at line 208 of file AssetManager.h.

◆ SkinAssetRef

Legacy asset reference type for skin assets.

Definition at line 210 of file AssetManager.h.

◆ TextureAssetRef

Legacy asset reference type for texture assets.

Definition at line 212 of file AssetManager.h.

Constructor & Destructor Documentation

◆ AssetManager() [1/2]

Engine::Core::AssetManager::AssetManager ( )

Creates an asset manager without an application context.

Texture resource creation APIs that need Vulkan context data require a context-backed manager.

◆ AssetManager() [2/2]

Engine::Core::AssetManager::AssetManager ( ApplicationContext * context)

Creates an asset manager bound to an application context.

Parameters
contextApplication context used for Vulkan resource creation.

References ApplicationContext, and context.

◆ ~AssetManager()

Engine::Core::AssetManager::~AssetManager ( )

Destroys owned asset managers and worker pools.

Call AssetManager::cleanup() before destruction when Vulkan texture resources are still resident.

Member Function Documentation

◆ attachToRenderer()

void Engine::Core::AssetManager::attachToRenderer ( Rendering::Renderer * renderer)

Attaches the renderer used for texture uploads and descriptor reservation notifications.

Existing file-backed and runtime descriptor reservations are registered with the renderer's RenderingDataManager when available.

Parameters
rendererRenderer used by asset upload paths. Passing nullptr detaches renderer access.

References renderer.

◆ cleanup()

void Engine::Core::AssetManager::cleanup ( )

Waits for asset jobs and releases loaded runtime texture resources.

This clears texture, cubemap, and descriptor-index maps owned by the manager.

◆ discardSceneLoadingData()

void Engine::Core::AssetManager::discardSceneLoadingData ( )

Drops queued or in-flight scene asset loading work.

Pending texture preparations are discarded when a renderer and rendering data manager are attached.

◆ doesTextureAlreadyExist()

bool Engine::Core::AssetManager::doesTextureAlreadyExist ( const std::filesystem::path & path)
private

Checks whether a texture path has a loaded identity entry.

Parameters
pathTexture path to check.
Returns
True when at least one resident texture identity exists for path.

◆ ensureFallbackTextureLocked()

void Engine::Core::AssetManager::ensureFallbackTextureLocked ( )
private

Creates the built-in fallback texture when it does not already exist.

The caller must hold AssetManager::textureMutex.

◆ getAnimationAssetManager()

Assets::AnimationAssetManager * Engine::Core::AssetManager::getAnimationAssetManager ( ) const
inlinenodiscard

Gets the animation asset manager for direct access.

Returns
Animation asset manager owned by this manager.

Definition at line 566 of file AssetManager.h.

References animationAssetManager_.

◆ getAsset()

template<typename AssetClass, typename Key>
auto Engine::Core::AssetManager::getAsset ( const Key & asset)
inlinenodiscard

Gets or creates an asset reference and requests loading when needed.

Supported asset classes and keys:

  • Assets::Mesh with Asset::MeshPath.
  • Assets::Material with Asset::MeshPath.
  • Assets::Animation with Asset::MeshPath.
  • Assets::Skin with Asset::MeshPath.
  • Assets::Texture with Asset::Path or std::filesystem::path.
  • Assets::Audio with Asset::Path or std::filesystem::path.

Mesh, animation, and skin requests can submit the owning glTF model for async loading. Texture and audio requests submit the referenced file when it is not already requested, loading, or loaded. Material requests return a ref only; material payloads are populated by model loading.

Template Parameters
AssetClassAsset class to request.
KeyKey type accepted by the selected asset class.
Parameters
assetAsset key.
Returns
Asset reference for the selected asset type.

Definition at line 235 of file AssetManager.h.

References animationAssetManager_, Asset::Path::getFilePath(), getMeshAsset(), loadAudioAsset(), loadEcsModel(), loadEcsTexture(), Asset::LOADED, Asset::LOADING, materialAssetManager, meshAssetManager, Asset::REQUESTED_LOAD, skinAssetManager_, textureAssetManager, and Asset::UNLOADED.

Here is the call graph for this function:

◆ getAssetImportPipeline()

Ecs::AssetImportPipeline & Engine::Core::AssetManager::getAssetImportPipeline ( )

Gets the master asset import pipeline.

Returns
Master asset import pipeline owned by this manager.

◆ getAssetLoaderPool()

NamedThreadPool * Engine::Core::AssetManager::getAssetLoaderPool ( ) const
inline

Gets the worker pool used for asynchronous asset loading.

Returns
Asset loading worker pool owned by this manager.

Definition at line 628 of file AssetManager.h.

References threadPool_.

◆ getAudioAsset()

Assets::Audio * Engine::Core::AssetManager::getAudioAsset ( const Asset::Path & path)
nodiscard

Gets a loaded audio asset by path.

Parameters
pathAudio asset path.
Returns
Pointer to the loaded audio asset, or nullptr when it is not loaded.

◆ getAudioAssetManager()

Assets::AudioAssetManager * Engine::Core::AssetManager::getAudioAssetManager ( ) const
inlinenodiscard

Gets the audio asset manager for direct access.

Returns
Audio asset manager owned by this manager.

Definition at line 512 of file AssetManager.h.

References audioAssetManager_.

◆ getAudioAssetPipeline()

Ecs::AudioAssetPipeline & Engine::Core::AssetManager::getAudioAssetPipeline ( )

Gets the audio loading pipeline.

Returns
Audio asset pipeline owned by the master asset import pipeline.

◆ getCalculationPool()

NamedThreadPool * Engine::Core::AssetManager::getCalculationPool ( ) const
inline

Gets the worker pool used for asset-side CPU calculations.

Returns
Calculation worker pool owned by this manager.

Definition at line 619 of file AssetManager.h.

References threadedCalculation_.

◆ getImageCount()

uint32_t Engine::Core::AssetManager::getImageCount ( ) const

Gets the number of registered runtime texture identities.

Returns
Count of texture identities currently tracked by the manager.

◆ getMaterialAssetManager()

Assets::MaterialAssetManager * Engine::Core::AssetManager::getMaterialAssetManager ( ) const
inlinenodiscard

Gets the material asset manager for material lookups.

Returns
Material asset manager owned by this manager.

Definition at line 530 of file AssetManager.h.

References materialAssetManager.

◆ getMeshAsset()

Assets::Mesh * Engine::Core::AssetManager::getMeshAsset ( const Asset::MeshPath & asset)
nodiscardprivate

Gets a mesh asset by path or requests its model if it is not loaded.

Parameters
assetMesh asset path.
Returns
Pointer to the loaded mesh asset, or nullptr when loading is pending.

Referenced by getAsset().

Here is the caller graph for this function:

◆ getMeshAssetManager()

Assets::MeshAssetManager * Engine::Core::AssetManager::getMeshAssetManager ( ) const
inlinenodiscard

Gets the mesh asset manager for mesh asset lookups.

Returns
Mesh asset manager owned by this manager.

Definition at line 548 of file AssetManager.h.

References meshAssetManager.

◆ getMeshAssetPipeline()

Ecs::ModelAssetPipeline & Engine::Core::AssetManager::getMeshAssetPipeline ( )

Gets the glTF model loading pipeline.

Returns
Model asset pipeline owned by the master asset import pipeline.

◆ getModelAssetManager()

Assets::ModelAssetManager * Engine::Core::AssetManager::getModelAssetManager ( ) const
inlinenodiscard

Gets the model asset manager for model and glTF loading state lookups.

Returns
Model asset manager owned by this manager.

Definition at line 539 of file AssetManager.h.

References modelAssetManager.

◆ getOrCreateTextureHandleWithSlot() [1/2]

template<Assets::TextureType Type>
Assets::TypedTextureHandle< Type > Engine::Core::AssetManager::getOrCreateTextureHandleWithSlot ( const std::filesystem::path & path)
inlinenodiscard

Gets or creates a typed texture handle and reserves a stable descriptor slot for it.

Template Parameters
TypeSemantic texture type encoded in the returned handle.
Parameters
pathTexture path.
Returns
Typed texture handle for the path.

Definition at line 429 of file AssetManager.h.

References getOrCreateTextureHandleWithSlot().

Here is the call graph for this function:

◆ getOrCreateTextureHandleWithSlot() [2/2]

Assets::TextureHandle Engine::Core::AssetManager::getOrCreateTextureHandleWithSlot ( const std::filesystem::path & path,
Assets::TextureType type )
nodiscard

Gets or creates a texture handle and reserves a stable descriptor slot for it.

The returned handle can resolve to a descriptor slot before the image is resident. A fallback texture is created when needed so reserved file-backed descriptors have a valid sampled image.

Parameters
pathTexture path.
typeSemantic texture type.
Returns
Texture handle for the path and type, or an invalid handle when registration fails.

Referenced by getOrCreateTextureHandleWithSlot().

Here is the caller graph for this function:

◆ getSkinAssetManager()

Assets::SkinAssetManager * Engine::Core::AssetManager::getSkinAssetManager ( ) const
inlinenodiscard

Gets the skin asset manager for direct access.

Returns
Skin asset manager owned by this manager.

Definition at line 557 of file AssetManager.h.

References skinAssetManager_.

◆ getTextureAssetPipeline()

Ecs::TextureAssetPipeline & Engine::Core::AssetManager::getTextureAssetPipeline ( )

Gets the texture loading pipeline.

Returns
Texture asset pipeline owned by the master asset import pipeline.

◆ getTextureDescriptorIndex() [1/2]

uint32_t Engine::Core::AssetManager::getTextureDescriptorIndex ( const std::filesystem::path & path)
nodiscard

Gets the descriptor index of a resident texture by path.

This overload is ambiguous when the same path is loaded for multiple texture types. Use the typed overload for material textures that can map to multiple formats.

Parameters
pathTexture path.
Returns
Descriptor index when exactly one resident texture matches, otherwise 0xFFFFFFFF.

◆ getTextureDescriptorIndex() [2/2]

uint32_t Engine::Core::AssetManager::getTextureDescriptorIndex ( const std::filesystem::path & path,
Assets::TextureType type )
nodiscard

Gets the descriptor index of a resident texture by path and semantic type.

Parameters
pathTexture path.
typeSemantic texture type used for identity lookup.
Returns
Descriptor index when the typed texture is resident, otherwise 0xFFFFFFFF.

◆ getTextureDescriptorInfos()

std::vector< VkDescriptorImageInfo > Engine::Core::AssetManager::getTextureDescriptorInfos ( ) const

Builds descriptor image info records for resident textures.

Returns
Descriptor image infos for texture slots that currently contain a texture.

◆ getTextureHandleRegistry()

Assets::Textures::TextureHandleRegistry * Engine::Core::AssetManager::getTextureHandleRegistry ( )
inlinenodiscard

Gets the texture handle registry for O(1) descriptor index lookups.

Returns
Texture handle registry owned by this manager.

Definition at line 575 of file AssetManager.h.

References textureHandleRegistry_.

◆ loadAudioAsset()

AudioAssetRef Engine::Core::AssetManager::loadAudioAsset ( const Asset::Path & path)

Submits an audio file for async loading through the audio pipeline.

Parameters
pathAudio asset path.
Returns
Audio asset ref for the requested path.

Referenced by getAsset().

Here is the caller graph for this function:

◆ loadEcsCubemap()

Assets::CubemapTexture * Engine::Core::AssetManager::loadEcsCubemap ( const std::filesystem::path & path)

Loads a six-face cubemap asset from a directory.

Cubemaps are cached by normalized path. Loading requires the asset manager to be attached to a renderer.

Parameters
pathDirectory containing the cubemap faces.
Returns
Loaded cubemap texture, existing cached cubemap, or nullptr when no renderer is attached.

◆ loadEcsModel()

void Engine::Core::AssetManager::loadEcsModel ( const std::filesystem::path & path)
private

Submits a glTF model file for asynchronous loading.

Parameters
pathglTF file path.

Referenced by getAsset().

Here is the caller graph for this function:

◆ loadEcsTexture()

void Engine::Core::AssetManager::loadEcsTexture ( const std::filesystem::path & path)
private

Submits a texture file for asynchronous loading.

Parameters
pathTexture file path.

Referenced by getAsset().

Here is the caller graph for this function:

◆ registerTexture() [1/2]

Assets::RuntimeTexture * Engine::Core::AssetManager::registerTexture ( const std::filesystem::path & path,
Assets::RuntimeTexture texture )
private

Creates Vulkan resources for a texture and registers it as file-backed texture data.

Parameters
pathTexture path.
textureRuntime texture to register.
Returns
Registered texture, or an existing texture for the same identity.

◆ registerTexture() [2/2]

Assets::RuntimeTexture * Engine::Core::AssetManager::registerTexture ( const std::filesystem::path & path,
Assets::TextureType type,
Assets::RuntimeTexture texture )
private

Creates Vulkan resources for a typed texture and registers it as file-backed texture data.

Parameters
pathTexture path.
typeSemantic texture type used for identity lookup.
textureRuntime texture to register.
Returns
Registered texture, or an existing texture for the same identity.

◆ registerTextureFromPrepared() [1/2]

Assets::RuntimeTexture * Engine::Core::AssetManager::registerTextureFromPrepared ( const std::filesystem::path & path,
Assets::RuntimeTexture texture )
private

Registers a texture whose Vulkan resources are already created.

This skips RuntimeTexture resource creation, assigns a descriptor index, and queues the texture for upload. The async texture preparation pipeline uses this path.

Parameters
pathTexture path.
texturePrepared texture with image, image view, and sampler resources.
Returns
Registered texture, or an existing texture for the same identity.

◆ registerTextureFromPrepared() [2/2]

Assets::RuntimeTexture * Engine::Core::AssetManager::registerTextureFromPrepared ( const std::filesystem::path & path,
Assets::TextureType type,
Assets::RuntimeTexture texture )
private

Registers a typed texture whose Vulkan resources are already created.

Parameters
pathTexture path.
typeSemantic texture type used for identity lookup.
texturePrepared texture with image, image view, and sampler resources.
Returns
Registered texture, or an existing texture for the same identity.

◆ releaseRuntimeTextureDescriptorIndex()

void Engine::Core::AssetManager::releaseRuntimeTextureDescriptorIndex ( uint32_t descriptorIndex)
private

◆ replaceTextureFromPrepared() [1/2]

Assets::RuntimeTexture * Engine::Core::AssetManager::replaceTextureFromPrepared ( const std::filesystem::path & path,
Assets::RuntimeTexture texture )
private

Replaces an already registered texture while preserving its descriptor index.

Parameters
pathTexture path.
texturePrepared replacement texture.
Returns
Replaced texture, or a newly registered texture when no matching texture exists.

◆ replaceTextureFromPrepared() [2/2]

Assets::RuntimeTexture * Engine::Core::AssetManager::replaceTextureFromPrepared ( const std::filesystem::path & path,
Assets::TextureType type,
Assets::RuntimeTexture texture )
private

Replaces an already registered typed texture while preserving its descriptor index.

Parameters
pathTexture path.
typeSemantic texture type used for identity lookup.
texturePrepared replacement texture.
Returns
Replaced texture, or a newly registered texture when no matching texture exists.

◆ reserveRuntimeTextureDescriptor()

Assets::RuntimeTextureDescriptorLease Engine::Core::AssetManager::reserveRuntimeTextureDescriptor ( )
nodiscard

Reserves a stable descriptor index for a runtime-generated sampled image.

The descriptor is tracked as runtime-owned and registered with the RenderingDataManager when attached. The caller owns descriptor writes for the image and must release the index when the image is destroyed.

Returns
Move-only lease that releases the slot when destroyed.

◆ setRenderingDataManager()

void Engine::Core::AssetManager::setRenderingDataManager ( RenderingDataManager * renderingDataManager)

Sets the rendering data manager used by asset pipelines.

The texture and model pipelines use this pointer to notify render data about prepared textures and loaded model resources.

Parameters
renderingDataManagerRendering data manager used by pipeline hooks.

References RenderingDataManager.

◆ unloadAllData()

void Engine::Core::AssetManager::unloadAllData ( )

Discards pending work and clears loaded asset manager state.

Runtime textures, cubemaps, texture handles, material refs, mesh refs, model refs, skin refs, animation refs, texture refs, and audio refs are cleared.

◆ unloadRuntimeTextures()

void Engine::Core::AssetManager::unloadRuntimeTextures ( )
private

Releases all runtime texture data and descriptor reservations owned by this manager.

◆ unregisterTexture()

void Engine::Core::AssetManager::unregisterTexture ( Assets::RuntimeTexture * texture)
private

Unregisters a runtime texture and clears its descriptor slot.

Parameters
textureTexture pointer returned by a registration function.

Member Data Documentation

◆ animationAssetManager_

Assets::AnimationAssetManager* Engine::Core::AssetManager::animationAssetManager_
private

Definition at line 603 of file AssetManager.h.

Referenced by getAnimationAssetManager(), and getAsset().

◆ ApplicationContext

friend Engine::Core::AssetManager::ApplicationContext
private

Definition at line 195 of file AssetManager.h.

Referenced by AssetManager().

◆ assetImportPipeline

Ecs::AssetImportPipeline Engine::Core::AssetManager::assetImportPipeline
private

Definition at line 612 of file AssetManager.h.

◆ audioAssetManager_

Assets::AudioAssetManager* Engine::Core::AssetManager::audioAssetManager_
private

Definition at line 611 of file AssetManager.h.

Referenced by getAudioAssetManager().

◆ context

ApplicationContext* Engine::Core::AssetManager::context = nullptr
private

Definition at line 636 of file AssetManager.h.

Referenced by AssetManager().

◆ cubemapTextures

std::unordered_map<std::filesystem::path, std::unique_ptr<Assets::CubemapTexture>, PathHasher> Engine::Core::AssetManager::cubemapTextures = {}
private

Definition at line 646 of file AssetManager.h.

◆ fallbackTextureDescriptorIndex_

uint32_t Engine::Core::AssetManager::fallbackTextureDescriptorIndex_ = Assets::TextureHandle::INVALID_ID
private

Definition at line 653 of file AssetManager.h.

◆ fileTextureDescriptorIndices_

std::unordered_set<uint32_t> Engine::Core::AssetManager::fileTextureDescriptorIndices_
private

Definition at line 652 of file AssetManager.h.

◆ gltfLoader

Assets::Loaders::GltfLoader Engine::Core::AssetManager::gltfLoader = Assets::Loaders::GltfLoader( threadPool_ )
private

Definition at line 634 of file AssetManager.h.

◆ materialAssetManager

Assets::MaterialAssetManager* Engine::Core::AssetManager::materialAssetManager
private

Definition at line 600 of file AssetManager.h.

Referenced by getAsset(), and getMaterialAssetManager().

◆ meshAssetManager

Assets::MeshAssetManager* Engine::Core::AssetManager::meshAssetManager
private

Definition at line 599 of file AssetManager.h.

Referenced by getAsset(), and getMeshAssetManager().

◆ modelAssetManager

Assets::ModelAssetManager* Engine::Core::AssetManager::modelAssetManager
private

Definition at line 601 of file AssetManager.h.

Referenced by getModelAssetManager().

◆ renderer

Rendering::Renderer* Engine::Core::AssetManager::renderer = nullptr
private

Definition at line 637 of file AssetManager.h.

Referenced by attachToRenderer().

◆ RenderingDataManager

friend Engine::Core::AssetManager::RenderingDataManager
private

Definition at line 196 of file AssetManager.h.

Referenced by setRenderingDataManager().

◆ runtimeTextureDescriptorIndices_

std::unordered_set<uint32_t> Engine::Core::AssetManager::runtimeTextureDescriptorIndices_
private

Definition at line 651 of file AssetManager.h.

◆ skinAssetManager_

Assets::SkinAssetManager* Engine::Core::AssetManager::skinAssetManager_
private

Definition at line 602 of file AssetManager.h.

Referenced by getAsset(), and getSkinAssetManager().

◆ textureAllocator

DescriptorIndexAllocator Engine::Core::AssetManager::textureAllocator
private

Definition at line 650 of file AssetManager.h.

◆ textureAssetManager

Assets::TextureAssetManager* Engine::Core::AssetManager::textureAssetManager
private

Definition at line 598 of file AssetManager.h.

Referenced by getAsset().

◆ textureData

std::array<std::optional<Assets::RuntimeTexture>, MAX_TEXTURE_COUNT> Engine::Core::AssetManager::textureData
private

Definition at line 649 of file AssetManager.h.

◆ textureHandleRegistry_

Assets::Textures::TextureHandleRegistry Engine::Core::AssetManager::textureHandleRegistry_
private

Registry for type-safe texture handles.

Definition at line 609 of file AssetManager.h.

Referenced by getTextureHandleRegistry().

◆ textureIdentitiesByPath_

std::unordered_map<std::string, std::vector<Assets::Textures::TextureIdentityKey> > Engine::Core::AssetManager::textureIdentitiesByPath_
private

Definition at line 644 of file AssetManager.h.

◆ textureIndexMap

BidirectionalMap<uint32_t, Assets::RuntimeTexture *> Engine::Core::AssetManager::textureIndexMap
private

Definition at line 647 of file AssetManager.h.

◆ textureMutex

std::mutex Engine::Core::AssetManager::textureMutex
private

Definition at line 755 of file AssetManager.h.

◆ textures

std::unordered_map< Assets::Textures::TextureIdentityKey, Assets::RuntimeTexture *, Assets::Textures::TextureIdentityKeyHash> Engine::Core::AssetManager::textures = {}
private

Definition at line 643 of file AssetManager.h.

◆ texturesToCopyImageData

std::vector<Assets::RuntimeTexture *> Engine::Core::AssetManager::texturesToCopyImageData
private

Definition at line 758 of file AssetManager.h.

◆ texturesToUpload

std::vector<TextureStorage> Engine::Core::AssetManager::texturesToUpload {}
private

Definition at line 757 of file AssetManager.h.

◆ threadedCalculation_

NamedThreadPool* Engine::Core::AssetManager::threadedCalculation_ = nullptr
private

Definition at line 596 of file AssetManager.h.

Referenced by getCalculationPool().

◆ threadPool_

NamedThreadPool* Engine::Core::AssetManager::threadPool_ = nullptr
private

Definition at line 595 of file AssetManager.h.

Referenced by getAssetLoaderPool().


The documentation for this class was generated from the following file:
  • /workspace/magerbeton/gl3-vulkan/code/Engine/include/Engine/Mesh/AssetManager.h